Ejemplo n.º 1
0
 public function hasIdentity()
 {
     if (!empty($this->_identity)) {
         return true;
     }
     $zadmin_auth = Zing_Cookies::getCookie(self::COOKIE_ADMIN_AUTH_KEY);
     if (empty($zadmin_auth) || !Zing_Auth_Util::checkSessionKey($zadmin_auth)) {
         Zing_Cookies::clearCookies($zadmin_auth);
         return false;
     }
     $storage = $this->getStorage();
     $storage->setZAdminAuthKey($zadmin_auth);
     $identity = $storage->read();
     if (!empty($identity)) {
         //Identity in cache is array
         $this->_identity = new stdClass();
         $this->_identity->userid = $identity["userid"];
         $this->_identity->username = $identity["username"];
         $this->_identity->appid = $identity["appid"];
         $this->_identity->name = $identity["name"];
         $this->_identity->appname = $identity["appname"];
         $this->_identity->adminflg = $identity['adminflg'];
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 private function _getCookies()
 {
     $cookies = new stdClass();
     $cookies->vngauth = Zing_Cookies::getCookie('vngauth');
     return $cookies;
 }