diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 61fd973796e..0332e335f70 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -714,6 +714,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 b31e8b4b859..481d0651312 100644 --- a/login/change_password.php +++ b/login/change_password.php @@ -44,7 +44,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, @@ -64,11 +64,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();