Permalink
Browse files

MDL-9764 Require_course_login() should check cm visibility in frontpa…

…ge course too
  • Loading branch information...
1 parent d09a98e commit b68ae6fca76a88b66818b40437daf4e74b63c883 skodak committed May 10, 2007
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/moodlelib.php
View
@@ -1873,9 +1873,16 @@ function require_course_login($courseorid, $autologinguest=true, $cm=null) {
if (!empty($CFG->forcelogin)) {
// login required for both SITE and courses
require_login($courseorid, $autologinguest, $cm);
+
+ } else if (!empty($cm) and !$cm->visible) {
+ // always login for hidden activities
+ require_login($courseorid, $autologinguest, $cm);
+
} else if ((is_object($courseorid) and $courseorid->id == SITEID)
or (!is_object($courseorid) and $courseorid == SITEID)) {
//login for SITE not required
+ return;
+
} else {
// course login always required
require_login($courseorid, $autologinguest, $cm);

0 comments on commit b68ae6f

Please sign in to comment.