/** * Logouts layer */ public function logout() { if (!$this->isPlayerConnected()) { return; } //LoginTracking::addLogoutTracking(AuthenticationTool::SESSION_PLAYER_ID); SessionTool::getInstance()->emptySession(); }
/** * 验证验证码与session库中的值是否一致>>>不区分大小写 * @param string $code 输入的验证码 * @return bool 成功或失败 */ public static function check($code) { SessionTool::getInstance(); $rst = isset($_SESSION['code']) && strtoupper($_SESSION['code']) == strtoupper($code); //抓换大写 unset($_SESSION['code']); return $rst; }
/** * 实例化数据库对象,连接数据库,完成基本设置 */ public static function sess_open() { $setting = $GLOBALS['config']['session']; self::$table_name = $GLOBALS['config']['session']['table_name']; if (isset($setting['type']) && $setting['type'] == 'mysql') { self::$db = MysqlDb::getInstance($setting); } else { self::$db = PDOMysql::getInstance($setting); } }
$color = '#5FF'; // Cyan break; case "[1;35m": $color = '#F5F'; // Purple break; case "[0;02m": $color = '#BBB'; // White // White default: $color = isset($color) ? $color : '#bbb'; $truncate = false; break; } ?> <p id="msg<?php echo $index; ?> " class="chatLine" style="color: <?php echo $color; ?> "><?php echo htmlspecialchars($truncate ? StringTool::truncateFirstChars($logFile[$index], 7) : $logFile[$index]); ?> </p> <?php } SessionTool::getInstance()->setParameter('startLine', $lineCount);
/** * @return bool */ protected static function isLogged() { $userID = SessionTool::getSession( MMUsers::SESSION_USER_KEY ); return is_string($userID) && !MMUsers::isAnonymous($userID); }
<?php /* @type $Params string[] */ if ( in_array( 'register-with-facebook', $Params['Parameters'] ) || in_array( 'social-register-confirmation', $Params['Parameters'] ) ) { header('X-Frame-Options:'); } $outputType = 'html'; $controller = BlockFactory::factory ( $Params, $outputType ); try { $controller->buildResult (); $Result = $controller->getResult(); } catch ( Exception $e ) { $Result = $controller->getResult(); $statusReason = HttpTool::$statusReason[$Result['error_status']]; header("{$_SERVER['SERVER_PROTOCOL']} {$Result['error_status']} {$statusReason}"); } SessionTool::flush();
/** * @param string $sessionKey */ static public function destroySession ( $sessionKey ) { if ( MMUserLogin::$isLogin ) { eZSession::unsetkey( $sessionKey ); } else { if ( isset(self::$_localSession[$sessionKey]) ) { unset(self::$_localSession[$sessionKey]); self::$_isDirty = true; } } }
/** * @param boolean $in * @return boolean */ public function isAutologin( $in = null ) { if( is_null($in) ) return SessionTool::getSession(__CLASS__.'::isAutologin', false); else SessionTool::setSession(__CLASS__.'::isAutologin', $in); return null; }
/** * @param string $key * @return mixed */ public function getApplicationSessionValue ( $key ) { $applicationSession = SessionTool::getSession( $this->applicationName() ); if ( isset( $applicationSession[$key]) ) { return $applicationSession[$key]; } return null; }