Merge branch 'MDL-34965_master' of git://github.com/dmonllao/moodle

This commit is contained in:
Dan Poltawski
2012-10-30 16:05:43 +08:00
+8
View File
@@ -2809,6 +2809,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)) {