mirror of
https://github.com/moodle/moodle.git
synced 2025-02-02 06:10:08 +01:00
Some changes to make login a little more robust on some sites that have
multiple addresses
This commit is contained in:
parent
70fb77128f
commit
9698bf15b9
@ -65,19 +65,20 @@
|
|||||||
|
|
||||||
set_moodle_cookie($USER->username);
|
set_moodle_cookie($USER->username);
|
||||||
|
|
||||||
|
$wantsurl = $SESSION->wantsurl;
|
||||||
|
|
||||||
|
unset($SESSION->wantsurl);
|
||||||
unset($SESSION->lang);
|
unset($SESSION->lang);
|
||||||
|
|
||||||
if (user_not_fully_set_up($USER)) {
|
if (user_not_fully_set_up($USER)) {
|
||||||
$site = get_site();
|
$site = get_site();
|
||||||
redirect("$CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id");
|
redirect("$CFG->wwwroot/user/edit.php?id=$USER->id&course=$site->id");
|
||||||
|
|
||||||
} else if (empty($SESSION->wantsurl)) {
|
} else if (strpos($wantsurl, $CFG->wwwroot) === 0) { /// Matches site address
|
||||||
redirect("$CFG->wwwroot/");
|
redirect($wantsurl);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$wantsurl = $SESSION->wantsurl;
|
redirect("$CFG->wwwroot/"); /// Go to the standard home page
|
||||||
unset($SESSION->wantsurl);
|
|
||||||
redirect($wantsurl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reset_login_count();
|
reset_login_count();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user