From 2eb05176442f299610c03a8bbc3a6d3d8ec91b43 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 22 Jun 2017 21:05:58 +1200 Subject: [PATCH] coding guidline improvements. --- password.php | 5 +++-- password_ajax.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/password.php b/password.php index 11f2724..041d618 100644 --- a/password.php +++ b/password.php @@ -1,5 +1,4 @@ get_record('attendance_sessions', array('id' => $session), '*', MUST_EXIST); $cm = get_coursemodule_from_instance('attendance', $session->attendanceid); +require_login($cm->course, $cm); + $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)) { exit; } diff --git a/password_ajax.php b/password_ajax.php index 47bb82a..4faf694 100644 --- a/password_ajax.php +++ b/password_ajax.php @@ -1,5 +1,4 @@ get_record('attendance_sessions', array('id' => $session), '*', MUST_EXIST); $cm = get_coursemodule_from_instance('attendance', $session->attendanceid); +require_login($cm->course, $cm); + $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)) { exit; }