<?php

defined('PH7') or exit('Restricted access');
if (!\PH7\Admin::auth()) {
    exit('Restricted access');
}
// Accessible only for the Admin users
error_reporting(0);
// Set E_ALL for debuging
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'elFinderConnector.class.php';
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'elFinder.class.php';
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'elFinderVolumeDriver.class.php';
include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'elFinderVolumeLocalFileSystem.class.php';
// Required for MySQL storage connector
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeMySQL.class.php';
// Required for FTP connector support
// include_once dirname(__FILE__).DIRECTORY_SEPARATOR.'elFinderVolumeFTP.class.php';
/**
 * Simple function to demonstrate how to control file access using "accessControl" callback.
 * This method will disable accessing files/folders starting from  '.' (dot)
 *
 * @param  string  $attr  attribute name (read|write|locked|hidden)
 * @param  string  $path  file path relative to volume root directory started with directory separator
 * @return bool|null
 **/
function access($attr, $path, $data, $volume)
{
    return strpos(basename($path), '.') === 0 ? !($attr == 'read' || $attr == 'write') : null;
    // else elFinder decide it itself
}
$opts = array('roots' => array(array('driver' => 'LocalFileSystem', 'path' => PH7_PATH_ROOT, 'URL' => PH7_URL_ROOT, 'accessControl' => 'access')));
示例#2
0
        $this->_bStatus = $this->_oAdsModel->setStatus($this->_oHttpRequest->post('adsId'), 0, $sTable);
        if ($this->_bStatus) {
            (new Framework\Cache\Cache())->start(Design::CACHE_STATIC_GROUP, null, null)->clear();
            $this->_sMsg = jsonMsg(1, t('The deactivate we been deleted.'));
        } else {
            $this->_sMsg = jsonMsg(0, t('Cannot deactivate Advertisement, please try later.'));
        }
        echo $this->_sMsg;
    }
    protected function delete()
    {
        $sTable = AdsCore::getTable();
        $this->_bStatus = $this->_oAdsModel->delete($this->_oHttpRequest->post('adsId'), $sTable);
        if ($this->_bStatus) {
            /* Clean AdminCoreModel Ads and Model\Design for STATIC data */
            (new Framework\Cache\Cache())->start(Design::CACHE_STATIC_GROUP, null, null)->clear()->start(AdsCoreModel::CACHE_GROUP, 'totalAds', null)->clear()->start(AdsCoreModel::CACHE_GROUP, 'totalAdsAffiliates', null)->clear();
            $this->_sMsg = jsonMsg(1, t('The Advertisement we been deleted.'));
        } else {
            $this->_sMsg = jsonMsg(0, t('Cannot remove Advertisement, please try later.'));
        }
        echo $this->_sMsg;
    }
    public function __destruct()
    {
        unset($this->_oHttpRequest, $this->_oAdsModel, $this->_sMsg, $this->_bStatus);
    }
}
// Only for the Admins
if (Admin::auth()) {
    new AdsAjax();
}