From 54598fb04ee729dd37529d8a4ce3fd8a0cdde3a2 Mon Sep 17 00:00:00 2001 From: defacer Date: Thu, 16 Dec 2004 17:26:29 +0000 Subject: [PATCH] The user editing screen and the change password screen didn't play very well with debug = on. In fact the change password screen didn't play at all. Made a few small changes to fix notices and now everything works OK. Added a missing language string. ***************** This problem may very well exist in MOODLE_14_STABLE too! Unfortunately I don't have access to a 1.4 checkout right now, so it will have to wait. ***************** --- lang/en/moodle.php | 1 + login/change_password.php | 9 +++------ user/edit.html | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 9c230359fa..d87105e55f 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -715,6 +715,7 @@ $string['moveright'] = 'Move right'; $string['moveselectedcoursesto'] = 'Move selected courses to...'; $string['movetoanotherfolder'] = 'Move to another folder'; $string['moveup'] = 'Move up'; +$string['mustchangepassword'] = 'The new password must be different than the current one'; $string['mustconfirm'] = 'You need to confirm your login'; $string['mycourses'] = 'My courses'; $string['name'] = 'Name'; diff --git a/login/change_password.php b/login/change_password.php index 1559afd660..879c79cf81 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -67,7 +67,7 @@ $strpasswordchanged = get_string("passwordchanged"); - if ($course->id) { + if (!empty($course->id)) { add_to_log($course->id, "user", "change password", "view.php?id=$user->id&course=$course->id", "$user->id"); $fullname = fullname($USER, true); print_header($strpasswordchanged, $strpasswordchanged, @@ -86,11 +86,8 @@ } } - - - if ($course->id) { - $frm->id = $id; - } + // We NEED to set this, because the form assumes it has a value! + $frm->id = empty($course->id) ? 0 : $course->id; if (empty($frm->username)) { $frm->username = get_moodle_cookie(); diff --git a/user/edit.html b/user/edit.html index e695eb7a7f..f2c3d2f8f1 100644 --- a/user/edit.html +++ b/user/edit.html @@ -60,7 +60,7 @@ if (isadmin()) { } echo " "; echo "\n"; - if (!$adminself && ($CFG->{'auth_'.$user->auth.'_stdchangepassword'} || $CFG->changepassword)){ + if (!$adminself && (!empty($CFG->{'auth_'.$user->auth.'_stdchangepassword'}) || $CFG->changepassword)){ if (get_user_preferences('auth_forcepasswordchange', NULL, $user->id)) { $checked = ' checked="checked" '; } else { -- 2.39.5