Пример #1
0
 /**
  * Try to authenticate the user with the current session
  *
  * Authentication for externally-authenticated users will be revoked if the username changed or external
  * authentication is no longer in effect
  */
 public function authenticateFromSession()
 {
     $this->user = Session::getSession()->get('user');
     if ($this->user !== null && $this->user->isExternalUser() === true) {
         list($originUsername, $field) = $this->user->getExternalUserInformation();
         if (!array_key_exists($field, $_SERVER) || $_SERVER[$field] !== $originUsername) {
             $this->removeAuthorization();
         }
     }
 }
Пример #2
0
 /**
  * Try to authenticate the user with the current session
  *
  * Authentication for externally-authenticated users will be revoked if the username changed or external
  * authentication is no longer in effect
  */
 public function authenticateFromSession()
 {
     $this->user = Session::getSession()->get('user');
     if ($this->user !== null && $this->user->isExternalUser()) {
         list($originUsername, $field) = $this->user->getExternalUserInformation();
         $username = ExternalBackend::getRemoteUser($field);
         if ($username === null || $username !== $originUsername) {
             $this->removeAuthorization();
         }
     }
 }