I want add new user from another script and I need create password for Drupal7 users, I can’t find exact function which is doing it on Drupal, what function is that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With drupal 7, password are no more encrypted through md5.
There are several way to get/set a password in drupal7.
Using drush (for your information, not used in your case):
Without drush, if you have a cli access to the server : (for your information, not used in your case)
Now copy the resultant hash and paste it into the query:
If you are working on a remote environment on which you cannot connect, you can put this specified code in a file such as password.php such as this one:
And then hit your site using: http://domain.tld/password.php?p=‘MyPassword’. The hash will appear on your browser’s tab.
Don’t forget to remove it once you done it.
So, if you want to use some password function generation, have a look on _password_crypt() and _password_generate_salt()