コード例 #1
0
ファイル: auth.php プロジェクト: savonix/nexista
 /**
  * Constructor - Inits session, config
  *
  */
 public function __construct()
 {
     $this->session = Nexista_Session::singleton('Nexista_Session');
     $this->session->start();
     //user already identified?
     if (isset($_SESSION[$this->_sessionName])) {
         $this->sessionData =& $_SESSION[$this->_sessionName];
     } else {
         //newbie - setup a new session
         $_SESSION[$this->_sessionName] = array();
         $this->sessionData =& $_SESSION[$this->_sessionName];
         $this->sessionData['status'] = self::NX_AUTH_STATUS_INACTIVE;
     }
 }
コード例 #2
0
ファイル: init.php プロジェクト: savonix/nexista
 /**
  * Init sessions
  *
  * This method starts up a session
  * and globalizes it.
  *
  * @return null
  */
 function initSession()
 {
     // Prefix is needed for Mozilla as its the 0 position.
     $ua = '_' . $_SERVER['HTTP_USER_AGENT'];
     if ((strpos($ua, 'Mozilla') || strpos($ua, 'Opera') || strpos($ua, 'Elinks')) && (!strpos($ua, 'Google') && !strpos($ua, 'Yahoo') && !strpos($ua, 'bot'))) {
         $this->session = Nexista_Session::singleton('Nexista_Session');
         $this->session->start();
     }
 }