1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00
This commit is contained in:
Eloy Lafuente (stronk7) 2016-09-14 01:38:51 +02:00
commit b5830334e7
2 changed files with 14 additions and 11 deletions

@ -73,6 +73,11 @@ information provided here is intended especially for developers.
* data-fieldtype="type" attribute has been added to form field default template.
* form elements extending MoodleQuickForm_group must call $this->createFormElement() instead of
@MoodleQuickForm::createElement() in order to be compatible with PHP 7.1
* Relative paths in $CFG->alternateloginurl will be resolved to absolute path within moodle site. Previously they
were resolved to absolute path within the server. That means:
- $CFG->wwwroot: http://example.com/moodle
- $CFG->alternateloginurl : /my/super/login.php
- Login url will be: http://example.com/moodle/my/super/login.php (moodle root based)
=== 3.1 ===

@ -282,23 +282,21 @@ if (empty($SESSION->wantsurl)) {
/// Redirect to alternative login URL if needed
if (!empty($CFG->alternateloginurl)) {
$loginurl = $CFG->alternateloginurl;
$loginurl = new moodle_url($CFG->alternateloginurl);
if (strpos($SESSION->wantsurl, $loginurl) === 0) {
//we do not want to return to alternate url
$SESSION->wantsurl = NULL;
$loginurlstr = $loginurl->out(false);
if (strpos($SESSION->wantsurl, $loginurlstr) === 0) {
// We do not want to return to alternate url.
$SESSION->wantsurl = null;
}
// If error code then add that to url.
if ($errorcode) {
if (strpos($loginurl, '?') === false) {
$loginurl .= '?';
} else {
$loginurl .= '&';
}
$loginurl .= 'errorcode='.$errorcode;
$loginurl->param('errorcode', $errorcode);
}
redirect($loginurl);
redirect($loginurl->out(false));
}
// make sure we really are on the https page when https login required