Esempio n. 1
0
 private static function _initHandler()
 {
     // @todo merge given config to the default one to avoid missing fields
     $sessCfg = Oops_Server::getConfig()->session;
     $handlerClass = 'Oops_Session_' . $sessCfg->handler;
     if (!class_exists($handlerClass)) {
         $handlerClass = 'Oops_Session_Native';
     }
     self::$session = new Oops_Session_Native($sessCfg);
 }
Esempio n. 2
0
 public function Check($passed, $keep = false)
 {
     Oops_Session::init();
     $k = $this->config->storage_key;
     if (empty($_SESSION[$k])) {
         return false;
     }
     if (($position = array_search($passed, $_SESSION[$k])) !== false) {
         if (!$keep) {
             array_splice($_SESSION[$k], $position, 1);
         }
         return true;
     }
     return false;
 }
Esempio n. 3
0
 /**
  * @deprecated Use Oops_Session::init()
  */
 public static function initSession()
 {
     require_once 'Oops/Session.php';
     Oops_Session::init();
 }