Merge branch 'w02_MDL-37483_m25_redirect' of git://github.com/skodak/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2013-01-14 23:29:55 +01:00
commit f38ac3510a

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