Third Party Contributions > API Based Plugins
changepasswd_sql and MD5 passwords
syadnom:
I am trying to get .3beta with changepasswd_sql going but my database uses MD5 encrypted passwords. The readme doesnt describe how to handle MD5 passwords instead of plaintext passwords.
Can anyone help me out on this?
rosali:
Do you mean how to get a md5 hash by PHP?
$md5 = md5("plain text");
techdude:
How do I put MD5 into the MYSQL Query? Here is the config.inc.php file:
// query to verify current password
// this query should return 1 result - the data returned is not used, the number of rows is counted to verify success
// %u will be replaced with the users username (from RC session)
// %o will be replaced with the users current password
// %n will be replaced with the users new password
$changepasswd_config['sql_select'] = "SELECT username FROM users WHERE username='%u' AND password='%o';";
// query to update password
// %u will be replaced with the users username (from RC session)
// %o will be replaced with the users current password
// %n will be replaced with the users new password
$changepasswd_config['sql_update'] = "UPDATE users SET password='%n' WHERE username='%u' AND password='%n';";
techdude:
Oh, and I'm using Postfixadmin
Posted via Mobile Device
JohnDoh:
have you tried this? note sure if the SQL is correct but mysql does support the md5 function.
--- Code: ---
$changepasswd_config['sql_select'] = "SELECT username FROM users WHERE username='%u' AND password=md5('%o');";
$changepasswd_config['sql_update'] = "UPDATE users SET password=md5('%n') WHERE username='%u' AND password=md5('%o');";
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version