mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
Merged SITEID check for require_login from stable
This commit is contained in:
parent
f6f319f852
commit
e351205034
@ -590,6 +590,9 @@ function require_login($courseid=0, $autologinguest=true) {
|
||||
|
||||
// Next, check if the user can be in a particular course
|
||||
if ($courseid) {
|
||||
if ($courseid == SITEID) {
|
||||
return; // Anyone can be in the site course
|
||||
}
|
||||
if (!empty($USER->student[$courseid]) or !empty($USER->teacher[$courseid]) or !empty($USER->admin)) {
|
||||
if (isset($USER->realuser)) { // Make sure the REAL person can also access this course
|
||||
if (!isteacher($courseid, $USER->realuser)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user