Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By jfha73 on
Hey guys,
I'm trying to change my user's password via database because the server is not sending emails, I tried using password('new_password') but it didn't work, was this changed in version 7.43?
Thanks.
Comments
It uses sha512, and also uses
It uses sha512, and also uses a salt for security sake. the actual function used for the hashing is: https://api.drupal.org/api/drupal/includes!password.inc/function/_passwo...
Suffice to say directly changing the user's password in the database is not likely to work so well. See if you can find the mail that failed to send in your server logs, and get the link to reset their password from there. If that doesn't exist, you can also use Drush to reset passwords.
Thanks, I'm back on track
Thanks, I'm back on track again.
Create password-change.php
Create password-change.php file equivalent to site folder and add below code on it.
if execute this file from browser, will get encrypted password for your plain text, then execute below query.
Example:
"UPDATE user SET pass='$S$CpiOFu0x5iXapILxJCsVJGbh2fHB11HLGjBDp2XbfofmpiqOd1xj' where uid='1';"