]> git.mjollnir.org Git - moodle.git/commitdiff
With external authentication, the change password button on the user
authormoodler <moodler>
Thu, 28 Nov 2002 12:31:46 +0000 (12:31 +0000)
committermoodler <moodler>
Thu, 28 Nov 2002 12:31:46 +0000 (12:31 +0000)
page now does the same thing as the one on the login page.  It takes you
to the specified URL is it exists, and just doesn't appear if there is no URL

lang/en/auth.php
user/view.php

index 5995e22896721ae8711dc52c443945d5557d19f9..07f1718d1d16be6a21bc31dc8b2cf2546f1f6593 100644 (file)
@@ -49,7 +49,7 @@ $string['auth_pop3type'] = "Server type. If your server uses certificate securit
 $string['authenticationoptions'] = "Authentication options";
 $string['authinstructions'] = "Here you can provide instructions for your users, so they know which username and password they should be using.  The text you enter here will appear on the login page.  If you leave this blank then no instructions will be printed.";
 $string['changepassword'] = "Change password URL";
-$string['changepasswordhelp'] = "Here you can specify a location at which your users can recover or change their username/password if they've forgotten it.  This will be provided to users as a button on the login page.  if you leave this blank the button will not be printed.";
+$string['changepasswordhelp'] = "Here you can specify a location at which your users can recover or change their username/password if they've forgotten it.  This will be provided to users as a button on the login page and their user page.  if you leave this blank the button will not be printed.";
 $string['chooseauthmethod'] = "Choose an authentication method: ";
 $string['guestloginbutton'] = "Guest login button";
 $string['showguestlogin'] = "You can hide or show the guest login button on the login page.";
index e00dd38cab0636b081d1436ca72e5615fe74e70d..00dc1cd3fefc9f2468abde86d8105f6dc8e53691 100644 (file)
 
     echo "</TD></TR></TABLE></TABLE>";
 
+    $internalpassword = false;
+    if ($CFG->auth == "email" or $CFG->auth == "none") {
+        $internalpassword = "$CFG->wwwroot/login/change_password.php";
+    }
+
 //  Print other functions
     echo "<CENTER><TABLE ALIGN=CENTER><TR>";
     if ($user->id == $USER->id and !isguest()) {
-        echo "<TD NOWRAP><P><FORM ACTION=\"$CFG->wwwroot/login/change_password.php\" METHOD=GET>";
-        echo "<INPUT type=hidden name=id value=\"$course->id\">";
-        echo "<INPUT type=submit value=\"".get_string("changepassword")."\">";
-        echo "</FORM></P></TD>";
+        if ($CFG->auth == "email" or $CFG->auth == "none") {
+            echo "<TD NOWRAP><P><FORM ACTION=\"$CFG->wwwroot/login/change_password.php\" METHOD=GET>";
+            echo "<INPUT type=hidden name=id value=\"$course->id\">";
+            echo "<INPUT type=submit value=\"".get_string("changepassword")."\">";
+            echo "</FORM></P></TD>";
+        } else if ($CFG->changepassword) {
+            echo "<TD NOWRAP><P><FORM ACTION=\"$CFG->changepassword\" METHOD=GET>";
+            echo "<INPUT type=submit value=\"".get_string("changepassword")."\">";
+            echo "</FORM></P></TD>";
+        }
     }
     if ((isstudent($course->id) and ($user->id == $USER->id) and !isguest()) or 
         (isteacher($course->id) and isstudent($course->id, $user->id)) ) {