MDL-37483 improve require_login redirect when activity not accessible

This commit is contained in:
Petr Škoda
2013-01-14 23:30:28 +01:00
committed by Eloy Lafuente (stronk7)
parent bff4fc86e1
commit 17c88e6ec9
+6 -1
View File
@@ -3082,7 +3082,12 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $
if ($preventredirect) {
throw new require_login_exception('Activity is hidden');
}
redirect($CFG->wwwroot, get_string('activityiscurrentlyhidden'));
if ($course->id != SITEID) {
$url = new moodle_url('/course/view.php', array('id'=>$course->id));
} else {
$url = new moodle_url('/');
}
redirect($url, get_string('activityiscurrentlyhidden'));
}
// Finally access granted, update lastaccess times