Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to separate the random password feature from the email feature. The randomly created passwords would have to be accessed programmatically (or using rules/views/etc), so there isn't necessarily a reason to only allow it when an email is set.
The strategy for the random password feature is affected by the strategy for the global password feature. (Ex: should a new password be created, or use the global one? How should the config options be set up?)
This might be a big enough change to wait for a 7.x-2.x or 8.x branch.
Comments
Comment #1
GrimreaperHello,
Thanks for the reflexion.
Firstly, the passwords are hashed, so if you generate a random password, you cannot access it in clear.
I quickly checked the protected_node_views module, you can only access the date of the last password change, if the node is protected and if the node show its title. So you cannot event access the hashed password.
Secondly, I quickly thought how to implement your feature. A checkbox on the node edit form if you want to generate a random password with a warning if a password already exists for the node. A checkbox on the content type edit form for the default state of this checkbox. And a checkbox on the protected node settings page for a global default state.
Does something like that respond to your request?
Comment #2
digitgopher CreditAttribution: digitgopher at Pacific Northwest National Laboratory commentedThat implementation sounds good, with at least a permission for changing the random checkbox on the node.
I noticed there exists a $node->protected_node_clear_passwd. What is this for and when is it available?
Comment #3
GrimreaperThis variable is to temporarily contain the password typed in clear on a node edit form so it can be sent by mail for example.
Comment #4
GrimreaperBack to active as the related issue is fixed.
Comment #5
GrimreaperHello,
Done in https://www.drupal.org/project/entity_access_password (D9 port).
Closing due to lack of activity and as D7 is EOL in november.