mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-36780 fix login redirect in require_login()
We can not redirect to login page when user is already logged in.
This commit is contained in:
parent
020e338dee
commit
8cd6d1aa6e
@ -2810,7 +2810,7 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
|
||||
}
|
||||
|
||||
// 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 ((!isloggedin() or isguestuser()) && !empty($SESSION->has_timed_out) && !$preventredirect && !empty($CFG->dbsessions)) {
|
||||
if ($setwantsurltome) {
|
||||
$SESSION->wantsurl = qualified_me();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user