Commit c2ef805b authored by bobthevirus's avatar bobthevirus Committed by Robert Lyon
Browse files

Bug 1771774: Allow override of externallogin redirect



When trying to hit a non homepage page where login is required

behatnotneeded

Change-Id: Ia52dff12c16dd58304bbe9251723311e3b18325e
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent e5c7527f
......@@ -1385,7 +1385,7 @@ function auth_draw_login_page($message=null, Pieform $form=null) {
}
$externallogin = get_config('externallogin');
if ($externallogin) {
if ($externallogin && !param_alphanum('override', false)) {
$externallogin = preg_replace('/{shorturlencoded}/', urlencode(get_relative_script_path()), $externallogin);
$externallogin = preg_replace('/{wwwroot}/', get_config('wwwroot'), $externallogin);
redirect($externallogin);
......
......@@ -397,6 +397,10 @@ $cfg->sslproxy = false;
*
* A point to note about the example below. Moodle doesn't strip the trailing slash from wwwroot
* Bug MDL-30042 fixes this, if this patch isn't applied, just hard code the login url you want instead
*
* Another point to note is if you need some system to render the local login page when accessing a restricted page
* rather than automatically redirect to externallogin you can override this by adding a 'override=1' to the URL of the page you are
* trying to access.
*/
// $cfg->externallogin = 'http://moodle.example.com/auth/mnet/jump.php?hostwwwroot={wwwroot}&wantsurl={shorturlencoded}';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment