When the admin is logged in as a different user, user events are shown
correctly in the calendar.
Also, fixed a very-recently-introduced bug which appears to have escaped
notice so far.
$allowed->courses = false; // This may change just below
$allowed->site = isadmin($USER->id);
- if(!empty($SESSION->cal_course_referer)) {
+ if(!empty($SESSION->cal_course_referer) && isteacheredit($SESSION->cal_course_referer, $USER->id)) {
$allowed->courses = array($SESSION->cal_course_referer => 1);
$allowed->groups = get_groups($SESSION->cal_course_referer);
}
}
if($SESSION->cal_show_user) {
- $user = $SESSION->cal_show_user;
+ // This ignores the "which user to see" setting
+ // The functionality to do that does exist, but this was
+ // the most painless way to solve bug 1323. And anyway,
+ // it wasn't being used anywhere.
+ $user = $USER->id;
+ //$user = $SESSION->cal_show_user;
}
else {
$user = false;