From: thepurpleblob Date: Thu, 1 Nov 2007 14:37:51 +0000 (+0000) Subject: MDL-11977: X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=fcd0ddbfba44ed0bd0834582b12eb1d1504b1754;p=moodle.git MDL-11977: Add an an optional forgotten password handling url Merged from STABLE_19 --- diff --git a/admin/auth.php b/admin/auth.php index fabfa5e69d..b36655180f 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -59,6 +59,7 @@ switch ($action) { // save settings set_config('guestloginbutton', required_param('guestloginbutton', PARAM_BOOL)); set_config('alternateloginurl', stripslashes(trim(required_param('alternateloginurl', PARAM_RAW)))); + set_config('forgottenpasswordurl', stripslashes(trim(required_param('forgottenpasswordurl', PARAM_RAW)))); set_config('registerauth', required_param('register', PARAM_SAFEDIR)); set_config('auth_instructions', stripslashes(trim(required_param('auth_instructions', PARAM_RAW)))); @@ -289,10 +290,20 @@ echo '
'; echo ''; -echo '\n"; +echo '\n"; echo '
' . get_string("alternatelogin", "auth", htmlspecialchars($CFG->wwwroot.'/login/index.php')) . '
'; echo '
'; +/// An alternate url for lost passwords. It means we can use external lost password +/// recovery for all users. Effectively disables built-in processes!!! +echo '
'; +echo ''; +echo '\n"; +echo '
' . get_string("forgottenpassword", "auth" ) . '
'; +echo '
'; + /// Instructions about login/password /// to be showed to users echo '
'; diff --git a/lang/en_utf8/auth.php b/lang/en_utf8/auth.php index 0987eb8a07..6837ba1e26 100644 --- a/lang/en_utf8/auth.php +++ b/lang/en_utf8/auth.php @@ -4,6 +4,8 @@ $string['alternatelogin'] = 'If you enter a URL here, it will be used as the login page for this site. The page should contain a form which has the action property set to \'$a\' and return fields username and password.
Be careful not to enter an incorrect URL as you may lock yourself out of this site.
Leave this setting blank to use the default login page.'; $string['alternateloginurl'] = 'Alternate Login URL'; +$string['forgottenpassword'] = 'If you enter a URL here, it will be used as the lost password recovery page for this site. This is intended for sites where passwords are handled entirely outside of Moodle. Leave this blank to use the default password recovery.'; +$string['forgottenpasswordurl'] = 'Forgotten password URL'; $string['pluginnotenabled'] = 'Authentication plugin \'$a\' is not enabled.'; $string['pluginnotinstalled'] = 'Authentication plugin \'$a\' is not installed.'; diff --git a/login/forgot_password.php b/login/forgot_password.php index 50d8a11027..286729db1d 100644 --- a/login/forgot_password.php +++ b/login/forgot_password.php @@ -21,6 +21,11 @@ $strlogin = get_string('login'); $navigation = build_navigation(array(array('name' => $strlogin, 'link' => "$CFG->wwwroot/login/index.php", 'type' => 'misc'), array('name' => $strforgotten, 'link' => null, 'type' => 'misc'))); +// if alternatepasswordurl is defined, then we'll just head there +if (!empty($CFG->forgottenpasswordurl)) { + redirect($CFG->forgottenpasswordurl); +} + // if you are logged in then you shouldn't be here! if (isloggedin() and !isguestuser()) { redirect($CFG->wwwroot.'/index.php', get_string('loginalready'), 5);