mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-34965 core_lib Redirect to the login page when session expires before autologin as guest
This commit is contained in:
parent
d71c486507
commit
12fc11e78f
1 changed files with 8 additions and 0 deletions
|
@ -2775,6 +2775,14 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
|||
$setwantsurltome = false;
|
||||
}
|
||||
|
||||
// Redirect to the login page if session has expired, only with dbsessions enabled (MDL-35029) to maintain current behaviour.
|
||||
if (!empty($SESSION->has_timed_out) && !$preventredirect && !empty($CFG->dbsessions)) {
|
||||
if ($setwantsurltome) {
|
||||
$SESSION->wantsurl = qualified_me();
|
||||
}
|
||||
redirect(get_login_url());
|
||||
}
|
||||
|
||||
// If the user is not even logged in yet then make sure they are
|
||||
if (!isloggedin()) {
|
||||
if ($autologinguest and !empty($CFG->guestloginbutton) and !empty($CFG->autologinguests)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue