2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Mnet access control created event class.
21 * @copyright 2013 Mark Nelson <markn@moodle.com>
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') || die();
28 class mnet_access_control_created extends base {
33 protected function init() {
34 $this->data['objecttable'] = 'mnet_sso_access_control';
35 $this->data['crud'] = 'c';
36 $this->data['edulevel'] = self::LEVEL_OTHER;
40 * Returns localised general event name.
44 public static function get_name() {
45 return get_string('eventaccesscontrolcreated', 'mnet');
49 * Returns relevant URL.
53 public function get_url() {
54 return new \moodle_url('admin/mnet/access_control.php');
58 * Returns description of what happened.
62 public function get_description() {
63 $mnetaccesscontrol = $this->get_record_snapshot('mnet_sso_access_control', $this->objectid);
64 $mnethost = $this->get_record_snapshot('mnet_host', $mnetaccesscontrol->mnet_host_id);
66 return 'Access control created for the user with the username \'' . $mnetaccesscontrol->username . '\' belonging
67 to the mnet host \'' . $mnethost->name . '\'';
71 * Return legacy data for add_to_log().
75 protected function get_legacy_logdata() {
76 $mnetaccesscontrol = $this->get_record_snapshot('mnet_sso_access_control', $this->objectid);
77 $mnethost = $this->get_record_snapshot('mnet_host', $mnetaccesscontrol->mnet_host_id);
79 return array(SITEID, 'admin/mnet', 'add', 'admin/mnet/access_control.php', 'SSO ACL: ' .
80 $mnetaccesscontrol->accessctrl . ' user \'' . $mnetaccesscontrol->username . '\' from ' .