Browse Source

coding guidline improvements.

MOODLE_32_STABLE
Dan Marsden 8 years ago
parent
commit
2eb0517644
  1. 5
      password.php
  2. 5
      password_ajax.php

5
password.php

@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// 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);
$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;
}

5
password_ajax.php

@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// 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);
$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;
}

Loading…
Cancel
Save