MDL-20385 better access control checks for frontpage activities
This commit is contained in:
+11
-3
@@ -2191,9 +2191,17 @@ function require_course_login($courseorid, $autologinguest=true, $cm=null, $setw
|
||||
|
||||
} else if ((is_object($courseorid) and $courseorid->id == SITEID)
|
||||
or (!is_object($courseorid) and $courseorid == SITEID)) {
|
||||
//login for SITE not required
|
||||
user_accesstime_log(SITEID);
|
||||
return;
|
||||
//login for SITE not required
|
||||
if ($cm and empty($cm->visible)) {
|
||||
// hidden activities are not accessible without login
|
||||
require_login($courseorid, $autologinguest, $cm, $setwantsurltome);
|
||||
} else if ($cm and !empty($CFG->enablegroupings) and $cm->groupmembersonly) {
|
||||
// not-logged-in users do not have any group membership
|
||||
require_login($courseorid, $autologinguest, $cm, $setwantsurltome);
|
||||
} else {
|
||||
user_accesstime_log(SITEID);
|
||||
return;
|
||||
}
|
||||
|
||||
} else {
|
||||
// course login always required
|
||||
|
||||
Reference in New Issue
Block a user