本文整理汇总了PHP中Authenticate::session方法的典型用法代码示例。如果您正苦于以下问题:PHP Authenticate::session方法的具体用法?PHP Authenticate::session怎么用?PHP Authenticate::session使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Authenticate
的用法示例。
在下文中一共展示了Authenticate::session方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pre
public function pre()
{
$this->user = Authenticate::session();
if (!is_a($this->user, 'Kadmin')) {
throw new Exception('Not Authorized', 401);
}
}
示例2: pre
public function pre()
{
$this->user = Authenticate::session();
if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') {
throw new Exception('Not Authorized', 401);
}
$this->targetLanguage = 'en';
C::s('LANG_DIR', realpath(ROOTDIR . '../locale/'));
$this->path = C::g('LANG_DIR') . '/' . C::g('LANG_AVAILABLE', $this->targetLanguage) . '/LC_MESSAGES/';
}
示例3: pre
public function pre()
{
$this->user = Authenticate::session();
if (!is_a($this->user, 'Kadmin') || $this->user->getType() != 'admin') {
throw new Exception('Not Authorized', 401);
}
if (is_string($this->param2) && !empty($this->param2)) {
$this->block = Block::getById($this->param2);
}
}
示例4: pre
public function pre()
{
$this->user = Authenticate::session();
if (!is_a($this->user, 'Kadmin')) {
throw new Exception('Not Authorized', 401);
}
if (MongoId::isValid($this->param2)) {
$this->page = KLib\instance::of('Page', $this->param2);
}
}
示例5: session_name
<?php
session_name('KNSESSID');
session_start();
require_once __DIR__ . '/../global.inc.php';
$user = Authenticate::session();
if (!is_a($user, 'Kadmin')) {
header('HTTP/1.1 401 Authorization Required');
exit(0);
}
$config = (include 'config/config.php');
//TODO switch to array
extract($config, EXTR_OVERWRITE);
include 'include/utils.php';
if ($_SESSION['RF']["verify"] != "RESPONSIVEfilemanager") {
response('forbiden', 403)->send();
exit;
}
include 'include/mime_type_lib.php';
if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== false || strpos($_POST['path'], './') === 0) {
response('wrong path', 400)->send();
exit;
}
if (strpos($_POST['name'], '/') !== false) {
response('wrong path', 400)->send();
exit;
}
$path = $current_path . $_POST['path'];
$name = $_POST['name'];
$info = pathinfo($name);
if (!in_array(fix_strtolower($info['extension']), $ext)) {