本文整理汇总了PHP中Doo::session方法的典型用法代码示例。如果您正苦于以下问题:PHP Doo::session方法的具体用法?PHP Doo::session怎么用?PHP Doo::session使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Doo
的用法示例。
在下文中一共展示了Doo::session方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: beforeRun
public function beforeRun($resource, $action)
{
$this->dir = ADMIN_ROOT . '/moban/';
$this->img = '/' . ADMIN_ROOT . '/static/';
$session = Doo::session('Lua');
$auth = $session->get('auth');
if (empty($auth)) {
$sets = Doo::cache('php')->get('loginset');
if ($sets && $sets['cardit'] == 1) {
$xxxx = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J');
$nums = range(1, 9);
shuffle($xxxx);
shuffle($nums);
$aaaa = $xxxx[0] . $nums[0];
$bbbb = $xxxx[1] . $nums[1];
$session->cardcode = $aaaa . '@' . $bbbb;
}
include Lua::display('login', $this->dir);
exit;
}
$auth = empty($auth) ? array(0, '') : Lua::clean(explode("\t", Lua::authcode($auth, 'DECODE')), 1);
$user = Lua::get_one("select * from lua_admin where uid='" . intval($auth[0]) . "' and password='" . $auth[1] . "' and gid='1'");
if (empty($user) || $user && $this->clientIP() != $user['loginip']) {
$session->auth = '';
Lua::admin_msg('操作提示', '请先登录', '/' . ADMIN_ROOT);
}
$rs = $this->acl()->process($user['perm'], $resource, $action);
if ($rs) {
return $rs;
}
$this->user = $user;
$this->page = Lua::get_post('p') ? intval(Lua::get_post('p')) : 1;
// 图片识别码, 借鉴自 supesite
define('FILE_HASH', substr(md5($user['uid'] . '/' . time() . Lua::random(6)), 8, 16));
}
示例2: index
public function index()
{
if ($this->user['perm'] != SUPER_MAN && SYSNAME != $this->user['channel']) {
header("Location:/" . $this->user['channel'] . '/admin/');
exit;
}
$list = Lua::get_more("select * from lua_channel where status='1'");
$cssname = 'nav_list';
if (SYSNAME != ADMIN_ROOT) {
$session = Doo::session('Lua');
$change_id = $session->get('change_id');
$set = Lua::get('set');
if ($set) {
$session->change_id = empty($change_id) || $change_id == 0 ? 1 : 0;
header("Location:/" . SYSNAME . "/" . ADMIN_ROOT . "/");
exit;
}
$set_id = $change_id || $change_id == 1 ? 1 : 0;
if ($set_id == 0) {
Doo::cache('php')->hashing = false;
$tree = Doo::cache('php')->get('category');
$cssname = 'tree_list';
$html = '';
if ($tree) {
$html = $this->_tree($tree, 0);
}
}
}
include Lua::display('frame', $this->dir);
}
示例3: logout
public function logout()
{
$session = Doo::session('Lua');
$auth = $session->get('auth');
$auth = empty($auth) ? array(0, '') : Lua::clean(explode("\t", Lua::authcode($auth, 'DECODE')), 1);
$user = Lua::get_one("select * from lua_admin where uid='" . intval($auth[0]) . "' and password='" . $auth[1] . "' and gid='1'");
if ($user) {
Lua::write_log($user, '退出系统', '---', $user['channel']);
}
$session->auth = '';
Lua::admin_msg('操作提示', '成功退出系统', '/' . ADMIN_ROOT);
}
示例4: start
/**
* Start auth component
*/
public function start()
{
$this->appSession = Doo::session($this->getApplicationName());
$this->validate();
}
示例5: beforeRun
public function beforeRun($resource, $action)
{
self::$session = Doo::session("IDMeasure");
IDGlobalController::$resource = $resource;
IDGlobalController::$action = $action;
IDGlobalController::$start = microtime(true);
IDGlobalController::$newparams = $this->params;
/*
if( $this->userparams['clientKey'] != 'TL27' ) {
$data['error'] = array( 'cod' => '401', 'desc' => 'Cliente no autorizado.' );
$this->renderc( $data );
exit( );
}
*/
IDGlobalController::$URI = $_SERVER['REQUEST_URI'];
/*
if( strpos( $_SERVER['REQUEST_URI'], '?' ) !== false )
$_SERVER['REQUEST_URI'] = substr( $_SERVER['REQUEST_URI'], 0, strpos( $_SERVER['REQUEST_URI'], '?' ) );
$_SERVER['REQUEST_URI'] = str_replace( '/' . $this->params['clientKey'] . '/', '/', $_SERVER['REQUEST_URI'] );
*/
if (!isset($this->params['format']) || !$this->params['format']) {
$this->params['format'] = 'json';
}
/*
if( $this->params['format'] == 'json' ) {
if( isset( $_REQUEST['callback'] ) && $_REQUEST['callback'] )
header( "Content-type: application/javascript; charset=utf-8" );
else
header( "Content-type: application/json; charset=utf-8" );
}
else if ( $this->params['format'] == 'xml' )
header( "Content-type: text/xml; charset=utf-8" );
*/
if (Doo::conf()->get('APP_MODE') != 'dev') {
/*
$lastModified = time( );
$uri = $_SERVER['REQUEST_URI'];
if( $uri[strlen( $uri ) - 1] == '/' ) {
$uri = substr( $uri, 0, strlen( $uri ) - 1 );
}
$cacheFile = Doo::conf()->SITE_PATH . Doo::conf()->PROTECTED_FOLDER . 'cache/frontend/' . str_replace( '/', '-', $uri ) . '.html';
if( strncmp( PHP_OS, 'WIN', 3 ) === 0 ) {
$cacheFile = str_replace( '?', '_q.', $cacheFile );
}
if ( file_exists( $cacheFile ) ) {
$lastModified = filemtime( $cacheFile );
}
$ts = gmdate("D, d M Y H:i:s", $lastModified ) . " GMT";
header("Last-Modified: $ts", true);
$ts = gmdate("D, d M Y H:i:s", $lastModified + self::DEFAULT_TIME_CACHE ) . " GMT";
header("Expires: $ts", true);
header("Pragma: cache", true);
//header_remove("Cache-Control");
header("Cache-Control: max-age=" . self::DEFAULT_TIME_CACHE, true );
*/
}
if (isset($_REQUEST['callback']) && $_REQUEST['callback']) {
echo $_REQUEST['callback'] . '(';
register_shutdown_function("IDGlobalController::shutdown_function");
} else {
register_shutdown_function("IDGlobalController::shutdown_log_function");
}
/*
if( Doo::conf( )->get( 'APP_MODE' ) != 'dev' && $this->params['clientKey'] != 'NOC21' ) {
Doo::cache('front')->get( self::DEFAULT_TIME_CACHE );
}
if( Doo::conf( )->get( 'APP_MODE' ) != 'dev' && $this->params['clientKey'] != 'NOC21' )
Doo::cache('front')->start( );
*/
}
示例6: getAAAToken
public function getAAAToken()
{
$sessiondata = Doo::session("ottpcbackend");
return $sessiondata->aaatoken;
}