|
@ -1,5 +1,4 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
// This file is part of Moodle - http://moodle.org/ |
|
|
// This file is part of Moodle - http://moodle.org/ |
|
|
// |
|
|
// |
|
|
// Moodle is free software: you can redistribute it and/or modify |
|
|
// Moodle is free software: you can redistribute it and/or modify |
|
@ -32,8 +31,10 @@ $session = required_param('session', PARAM_INT); |
|
|
$session = $DB->get_record('attendance_sessions', array('id' => $session), '*', MUST_EXIST); |
|
|
$session = $DB->get_record('attendance_sessions', array('id' => $session), '*', MUST_EXIST); |
|
|
|
|
|
|
|
|
$cm = get_coursemodule_from_instance('attendance', $session->attendanceid); |
|
|
$cm = get_coursemodule_from_instance('attendance', $session->attendanceid); |
|
|
|
|
|
require_login($cm->course, $cm); |
|
|
|
|
|
|
|
|
$context = context_module::instance($cm->id); |
|
|
$context = context_module::instance($cm->id); |
|
|
$capabilities = array('mod/attendance:manageattendances', 'mod/attendance:takeattendances','mod/attendance:changeattendances'); |
|
|
$capabilities = array('mod/attendance:manageattendances', 'mod/attendance:takeattendances', 'mod/attendance:changeattendances'); |
|
|
if (!has_any_capability($capabilities, $context)) { |
|
|
if (!has_any_capability($capabilities, $context)) { |
|
|
exit; |
|
|
exit; |
|
|
} |
|
|
} |
|
|