From 0bbef3919cc77981df96917e2f05097c18c35750 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Sun, 4 Dec 2005 22:30:17 +0000 Subject: [PATCH] Fixing problem where admins couldn't change their password (with external auth) --- login/change_password.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/login/change_password.php b/login/change_password.php index 02646cde482..de6cfa78a9c 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -137,6 +137,10 @@ *****************************************************************************/ function validate_form($frm, &$err) { + // we always need to call this because it handles the + // loading of the auth libraries, and we need that for later. + $validatepw = authenticate_user_login($frm->username, $frm->password); + if (empty($frm->username)){ $err->username = get_string('missingusername'); } else { @@ -145,7 +149,7 @@ function validate_form($frm, &$err) { } else { if (!isadmin()) { //require non adminusers to give valid password - if(!authenticate_user_login($frm->username, $frm->password)) { + if(!$validatepw) { $err->password = get_string('wrongpassword'); } }