本文整理汇总了PHP中Tool::requireAuth方法的典型用法代码示例。如果您正苦于以下问题:PHP Tool::requireAuth方法的具体用法?PHP Tool::requireAuth怎么用?PHP Tool::requireAuth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tool
的用法示例。
在下文中一共展示了Tool::requireAuth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Page
public function Page()
{
if ($this->requireAuth) {
Tool::requireAuth();
}
$this->gatherParameterFromRequest();
if (Conf::get('PROD')) {
$this->addScript('js/_prod/lib.js');
$this->addScript('js/_prod/base.js');
} else {
$files = array();
$files = array_merge($files, array_reverse(Tool::scanDirectory('js/lib', true)));
$files = array_merge($files, array_reverse(Tool::scanDirectory('js')));
foreach ($files as $file) {
$this->addScript($file);
}
}
}
示例2: Page
public function Page()
{
if ($this->requireAuth) {
Tool::requireAuth();
}
$this->gatherParameterFromRequest();
if (Conf::get('PROD')) {
$this->addScript('_prod/lib.js');
$this->addScript('_prod/base.js');
} else {
$files = array();
foreach (scandir(Conf::get('ROOT_DIR') . 'js/lib') as $file) {
if (preg_match('/(\\.js)$/i', $file)) {
$files[] = 'lib/' . $file;
}
}
foreach (scandir(Conf::get('ROOT_DIR') . 'js') as $file) {
if (preg_match('/(\\.js)$/i', $file)) {
$files[] = $file;
}
}
if (file_exists(Conf::get('ROOT_DIR') . 'js/order.json')) {
$order = json_decode(file_get_contents(Conf::get('ROOT_DIR') . 'js/order.json'));
$n = 0;
foreach ($order as $file) {
$key = array_search($file, $files);
if ($key !== false) {
$item = $files[$n];
$files[$n] = $file;
$files[$key] = $item;
$n++;
}
}
}
foreach ($files as $file) {
$this->addScript($file);
}
}
}
示例3: Remote
public function Remote()
{
if ($this->requireAuth) {
Tool::requireAuth();
}
}
示例4: init
static $tpl;
static function init()
{
self::$tpl = new Template();
}
}
Globals::init();
// STATS
function addStatsHeaders()
{
header('X-MySQL_Stats: ' . number_format(DB::$totalQueryTime, 3) . ' sc (nb ' . DB::$totalQuery . ')');
header('X-PHP_Stats: ' . number_format(microtime(true) - START_TIME, 3) . ' sc (tpl ' . number_format(Globals::$tpl->execTime, 3) . 'sc)');
}
// AUTH
if (Conf::get('AUTH_ENABLED')) {
Tool::requireAuth();
}
// TEMPLATE ENGINE
Globals::$tpl->cacheTimeCoef = Conf::get('CACHE_TIMECOEF');
Globals::$tpl->assignVar(array('PAGE_TITLE' => Conf::get('PAGE_TITLE'), 'PAGE_DESCRIPTION' => Conf::get('PAGE_DESCRIPTION'), 'PAGE_KEYWORDS' => Conf::get('PAGE_KEYWORDS'), 'ROOT_PATH' => Conf::get('ROOT_PATH'), 'MEDIA_PATH' => Conf::get('MEDIA_PATH'), 'VERSION' => Conf::get('VERSION')));
// DECTECT IF AJAX
if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
$ajax = true;
Globals::$tpl->assignSection('AJAX');
} else {
$ajax = false;
Globals::$tpl->assignSection('NOT_AJAX');
}
// REMOTES
if (isset($_GET['remote'])) {
$className = Tool::path2class($_GET['remote'], 'Remote');