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

Grimreaper’s picture

Hello,

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?

digitgopher’s picture

That 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?

Grimreaper’s picture

This variable is to temporarily contain the password typed in clear on a node edit form so it can be sent by mail for example.

Grimreaper’s picture

Status: Postponed » Active

Back to active as the related issue is fixed.

Grimreaper’s picture

Status: Active » Closed (works as designed)

Hello,

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.