__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?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/>.
namespace core\exception;
/**
* Exceptions indicating user does not have permissions to do something
* and the execution can not continue.
*
* @package core
* @subpackage exception
* @copyright 2009 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class required_capability_exception extends moodle_exception {
/**
* Constructor.
*
* @param \core\context $context The context used for the capability check
* @param string $capability The required capability
* @param string $errormessage The error message to show the user
* @param string $stringfile
*/
public function __construct($context, $capability, $errormessage, $stringfile) {
$capabilityname = get_capability_string($capability);
if ($context->contextlevel == CONTEXT_MODULE && preg_match('/:view$/', $capability)) {
// Cannot redirect to mod/xx/view.php because we most probably do not have cap to view it.
// Redirect to the course instead.
$parentcontext = $context->get_parent_context();
$link = $parentcontext->get_url();
} else {
$link = $context->get_url();
}
parent::__construct($errormessage, $stringfile, $link, $capabilityname);
}
}
// Alias this class to the old name.
// This file will be autoloaded by the legacyclasses autoload system.
// In future all uses of this class will be corrected and the legacy references will be removed.
class_alias(required_capability_exception::class, \required_capability_exception::class);
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| access_denied_exception.php | File | 1.19 KB | 0777 |
|
| coding_exception.php | File | 1.67 KB | 0777 |
|
| file_serving_exception.php | File | 1.51 KB | 0777 |
|
| invalid_dataroot_permissions.php | File | 1.55 KB | 0777 |
|
| invalid_parameter_exception.php | File | 1.66 KB | 0777 |
|
| invalid_response_exception.php | File | 1.63 KB | 0777 |
|
| invalid_state_exception.php | File | 1.91 KB | 0777 |
|
| moodle_exception.php | File | 3.96 KB | 0777 |
|
| not_found_exception.php | File | 1.69 KB | 0777 |
|
| require_login_exception.php | File | 1.55 KB | 0777 |
|
| require_login_session_timeout_exception.php | File | 1.49 KB | 0777 |
|
| required_capability_exception.php | File | 2.26 KB | 0777 |
|
| response_aware_exception.php | File | 1.16 KB | 0777 |
|
| webservice_parameter_exception.php | File | 1.86 KB | 0777 |
|