コード例 #1
0
ファイル: UserStorage.php プロジェクト: jedenweb/framework
 /**
  * Returns and initializes $this->sessionSection.
  * @param bool
  * @return Nette\Http\SessionSection
  */
 protected function getSessionSection($need)
 {
     $section = parent::getSessionSection($need);
     if ($section->authenticated && !$this->isIdentityValid($section->identity)) {
         $this->invalidateUser($section);
     }
     return $section;
 }
コード例 #2
0
ファイル: Storage.php プロジェクト: trejjam/authorization
 /**
  * Returns and initializes $this->sessionSection.
  * @return Nette\Http\SessionSection
  */
 protected function getSessionSection($need)
 {
     $ret = parent::getSessionSection($need);
     if (!is_null($ret)) {
         if ($ret->authenticated && $ret->identity->browser !== $this->browser->getName() && $ret->identity->browserVersion !== $this->browser->getVersion()) {
             $ret->authenticated = FALSE;
             $this->sessionHandler->regenerateId();
             $ret->reason = static::MANUAL;
             $ret->authTime = NULL;
         }
     }
     return $ret;
 }
コード例 #3
0
ファイル: UserStorage.php プロジェクト: arachne/security
 /**
  * @param bool $need
  * @return SessionSection
  */
 protected function getSessionSection($need)
 {
     if (!$this->sessionSection) {
         $section = parent::getSessionSection($need);
         if ($this->identityValidator && $section && $section->authenticated) {
             $identity = $this->identityValidator->validateIdentity($section->identity);
             if ($identity instanceof IIdentity) {
                 $section->identity = $identity;
             } else {
                 $section->authenticated = false;
                 $section->reason = FirewallInterface::LOGOUT_INVALID_IDENTITY;
                 if ($section->expireIdentity) {
                     unset($section->identity);
                 }
                 unset($section->expireTime, $section->expireDelta, $section->expireIdentity, $section->expireBrowser, $section->browserCheck, $section->authTime);
             }
         }
         $this->sessionSection = $section;
     }
     return $this->sessionSection;
 }