PDA

View Full Version : Change password class::method?


AustinKalb
08-28-2009, 03:20 PM
Can anyone tell me the the Data Manager class::method I can use to change a users password? If there is none, what is the programmatic procedure?

Thanks in advance!
Austin

Adrian Schneider
08-28-2009, 03:46 PM
$db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET password = md5(concat(md5('alphabet soup'), salt))
WHERE userid = 777
"); ... where 777 is the userid of the account you want to modify, and 'alphabet soup' is the new password.

AustinKalb
08-28-2009, 06:29 PM
$db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET password = md5(concat(md5('alphabet soup'), salt))
WHERE userid = 777
"); ... where 777 is the userid of the account you want to modify, and 'alphabet soup' is the new password.

This works great! Thanks.

How would I check for errors? the query_write seems to return a 1 with a valid or an invalid userid.


Thanks again!
Austin

Marco van Herwaarden
08-30-2009, 01:13 PM
Better use the datamanagers instead of a manual query.