Browse Source

Security fix to prevent access to other students attendance

MOODLE_23_STABLE
NeillM 11 years ago
committed by Dan Marsden
parent
commit
feca3fd8a7
  1. 9
      view.php

9
view.php

@ -63,7 +63,14 @@ $PAGE->navbar->add(get_string('attendancereport', 'attendance'));
$output = $PAGE->get_renderer('mod_attendance'); $output = $PAGE->get_renderer('mod_attendance');
$userid = isset($pageparams->studentid) ? $pageparams->studentid : $USER->id; if (isset($pageparams->studentid) && $USER->id != $pageparams->studentid) {
// Only users with proper permissions should be able to see any user's individual report.
require_capability('mod/attendance:viewreports', $PAGE->context);
$userid = $pageparams->studentid;
} else {
// A valid request to see another users report has not been sent, show the user's own.
$userid = $USER->id;
}
$userdata = new attendance_user_data($att, $userid); $userdata = new attendance_user_data($att, $userid);
echo $output->header(); echo $output->header();

Loading…
Cancel
Save