mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-61996 core: when loggedin always check user is complete
This commit is contained in:
parent
4864a25baf
commit
ce3f804683
2 changed files with 5 additions and 6 deletions
|
@ -38,7 +38,6 @@ if (!empty($CFG->defaulthomepage) && ($CFG->defaulthomepage == HOMEPAGE_MY) && o
|
|||
$urlparams['redirect'] = 0;
|
||||
}
|
||||
$PAGE->set_url('/', $urlparams);
|
||||
$PAGE->set_course($SITE);
|
||||
$PAGE->set_pagelayout('frontpage');
|
||||
$PAGE->set_other_editing_capability('moodle/course:update');
|
||||
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
|
||||
|
@ -47,11 +46,7 @@ $PAGE->set_other_editing_capability('moodle/course:activityvisibility');
|
|||
// Prevent caching of this page to stop confusion when changing page after making AJAX changes.
|
||||
$PAGE->set_cacheable(false);
|
||||
|
||||
if ($CFG->forcelogin) {
|
||||
require_login();
|
||||
} else {
|
||||
user_accesstime_log();
|
||||
}
|
||||
require_course_login($SITE);
|
||||
|
||||
$hasmaintenanceaccess = has_capability('moodle/site:maintenanceaccess', context_system::instance());
|
||||
|
||||
|
|
|
@ -3005,6 +3005,10 @@ function require_course_login($courseorid, $autologinguest = true, $cm = null, $
|
|||
// Always login for hidden activities.
|
||||
require_login($courseorid, $autologinguest, $cm, $setwantsurltome, $preventredirect);
|
||||
|
||||
} else if (isloggedin() && !isguestuser()) {
|
||||
// User is already logged in. Make sure the login is complete (user is fully setup, policies agreed).
|
||||
require_login($courseorid, $autologinguest, $cm, $setwantsurltome, $preventredirect);
|
||||
|
||||
} else if ($issite) {
|
||||
// Login for SITE not required.
|
||||
// We still need to instatiate PAGE vars properly so that things that rely on it like navigation function correctly.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue