]> git.mjollnir.org Git - moodle.git/commitdiff
login: Changing passwords now works when logged in as guest
authormartinlanghoff <martinlanghoff>
Thu, 18 May 2006 00:53:57 +0000 (00:53 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 18 May 2006 00:53:57 +0000 (00:53 +0000)
login/change_password.php
login/change_password_form.html

index 16008043007c92a658e75ed777133d4d0e7d820d..bc8dabf90081512d03d421969a075be042282eb6 100644 (file)
@@ -99,7 +99,7 @@
     // 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)) {
+    if (empty($frm->username) && !isguest()) {
         $frm->username = $USER->username;
     }
 
index 32d5648a848da973244ef263687d3cd81e58cfe2..38af4fec1953a37e543b8a336e20a010fa0d3386 100644 (file)
@@ -26,7 +26,7 @@
 <tr valign="top">\r
     <td><?php print_string("username") ?>:</td>\r
     <td>\r
-    <?php if (isadmin()) { ?>\r
+    <?php if (isadmin() || empty($frm->username)) { ?>\r
         <input type="text" name="username" size="25" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" />\r
     <?php } else { ?>\r
         <input type="hidden" name="username" value="<?php p($frm->username)?>" />  <?php p($frm->username)?>\r