xportde Posted March 16, 2020 Share Posted March 16, 2020 Hello together, I try to preset the password on creating users of a certain role by the hook Users::added in ready.php. This is successful (the pass field value is stored in the database), but in the following screen, where the new user data have to be specified, the password input is still required. Is there any chance to prevent this? If this is not possible, and the password would be entered manually, how could I read it later unhashed via API to send a mail to the new user? The scenario is: A user with appropriate permissions adds other users with other role, which should be informed by email about their credentials. Thanks in advance, Thomas. Link to comment Share on other sites More sharing options...
adrian Posted March 16, 2020 Share Posted March 16, 2020 I think you'll get what you want by hooking InputfieldPassword::render Take a look at this function: https://github.com/adrianbj/EmailNewUser/blob/026653e76328607540ad782b104b79defe776469/EmailNewUser.module.php#L86-L99 Link to comment Share on other sites More sharing options...
xportde Posted March 19, 2020 Author Share Posted March 19, 2020 Thank you, Adrian, that's exactly what I need! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now