MDL-8590 auth cleanup - reset password cleanup+fixes; backported from HEAD

This commit is contained in:
skodak
2007-02-22 22:25:18 +00:00
parent de4add7e1e
commit e8c5ac5251
8 changed files with 132 additions and 193 deletions
+2 -4
View File
@@ -3451,17 +3451,15 @@ function reset_password_and_mail($user) {
$site = get_site();
$from = get_admin();
$external = false;
$userauth = get_auth_plugin($user->auth);
if (!$userauth->can_change_password()) {
if (!$userauth->can_reset_password()) {
trigger_error("Attempt to reset user password for user $user->username with Auth $user->auth.");
return false;
}
$newpassword = generate_password();
if (!$userauth->user_update_password($user->username, $newpassword)) {
if (!$userauth->user_update_password(addslashes_recursive($user), addslashes($newpassword))) {
error("Could not set user password!");
}