当前位置: 首页>>代码示例>>PHP>>正文


PHP Doo::session方法代码示例

本文整理汇总了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));
 }
开发者ID:lianren,项目名称:doophp.cms,代码行数:35,代码来源:__auth.php

示例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);
 }
开发者ID:lianren,项目名称:doophp.cms,代码行数:30,代码来源:__home.php

示例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);
 }
开发者ID:lianren,项目名称:doophp.cms,代码行数:12,代码来源:__login.php

示例4: start

 /**
  * Start auth component
  */
 public function start()
 {
     $this->appSession = Doo::session($this->getApplicationName());
     $this->validate();
 }
开发者ID:no2key,项目名称:DooPHP,代码行数:8,代码来源:DooAuth.php

示例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( );
     */
 }
开发者ID:nelsondaza,项目名称:IDMeasure,代码行数:76,代码来源:IDGlobalController.php

示例6: getAAAToken

 public function getAAAToken()
 {
     $sessiondata = Doo::session("ottpcbackend");
     return $sessiondata->aaatoken;
 }
开发者ID:berlianaputri,项目名称:rps,代码行数:5,代码来源:UserSession.php


注:本文中的Doo::session方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。