]> git.mjollnir.org Git - moodle.git/commitdiff
The user editing screen and the change password screen didn't play very
authordefacer <defacer>
Thu, 16 Dec 2004 17:26:29 +0000 (17:26 +0000)
committerdefacer <defacer>
Thu, 16 Dec 2004 17:26:29 +0000 (17:26 +0000)
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
login/change_password.php
user/edit.html

index 9c230359fa0e8e9cc9e06691175521094bb92798..d87105e55f5c64e6a04c8bd7e08ca5ab3650a15f 100644 (file)
@@ -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';
index 1559afd660a7eab48fc9f0ae017a4558e61047b5..879c79cf8112e748848dea8d11f0060b4b888c66 100644 (file)
@@ -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&amp;course=$course->id", "$user->id");
                 $fullname = fullname($USER, true);
                 print_header($strpasswordchanged, $strpasswordchanged,
         }
     }
 
-
-
-    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();
index e695eb7a7fec522ff80a652f893a1373da25b77a..f2c3d2f8f140333e9fa8f477229ee54fe01793eb 100644 (file)
@@ -60,7 +60,7 @@ if (isadmin()) {
         }
         echo " </td>";
         echo "</tr>\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 {