original_string: public function reloadAccess(Auth $auth = null)
      {
          $this->resetSites();
  
          if (isset($auth)) {
              $this->auth = $auth;
          }
  
          if ($this->hasSuperUserAccess()) {
              $this->makeSureLoginNameIsSet();
              return true;
          }
  
          $this->token_auth = null;
          $this->login = null;
  
          // if the Auth wasn't set, we may be in the special case of setSuperUser(), otherwise we fail TODO: docs + review
          if (!isset($this->auth)) {
              return false;
          }
  
          // access = array ( idsite => accessIdSite, idsite2 => accessIdSite2)
          $result = $this->auth->authenticate();
  
          if (!$result->wasAuthenticationSuccessful()) {
              return false;
          }
  
          $this->login = $result->getIdentity();
          $this->token_auth = $result->getTokenAuth();
  
          // case the superUser is logged in
          if ($result->hasSuperUserAccess()) {
              $this->setSuperUserAccess(true);
          }
  
          return true;
      }
code: public function reloadAccess(Auth $auth = null)
      {
          $this->resetSites();
  
          if (isset($auth)) {
              $this->auth = $auth;
          }
  
          if ($this->hasSuperUserAccess()) {
              $this->makeSureLoginNameIsSet();
              return true;
          }
  
          $this->token_auth = null;
          $this->login = null;
  
          // if the Auth wasn't set, we may be in the special case of setSuperUser(), otherwise we fail TODO: docs + review
          if (!isset($this->auth)) {
              return false;
          }
  
          // access = array ( idsite => accessIdSite, idsite2 => accessIdSite2)
          $result = $this->auth->authenticate();
  
          if (!$result->wasAuthenticationSuccessful()) {
              return false;
          }
  
          $this->login = $result->getIdentity();
          $this->token_auth = $result->getTokenAuth();
  
          // case the superUser is logged in
          if ($result->hasSuperUserAccess()) {
              $this->setSuperUserAccess(true);
          }
  
          return true;
      }
code_tokens: public function reloadAccess ( Auth $ auth = null ) { $ this -> resetSites ( ) ; if ( isset ( $ auth ) ) { $ this -> auth = $ auth ; } if ( $ this -> hasSuperUserAccess ( ) ) { $ this -> makeSureLoginNameIsSet ( ) ; return true ; } $ this -> token_auth = null ; $ this -> login = null ; // if the Auth wasn't set, we may be in the special case of setSuperUser(), otherwise we fail TODO: docs + review if ( ! isset ( $ this -> auth ) ) { return false ; } // access = array ( idsite => accessIdSite, idsite2 => accessIdSite2) $ result = $ this -> auth -> authenticate ( ) ; if ( ! $ result -> wasAuthenticationSuccessful ( ) ) { return false ; } $ this -> login = $ result -> getIdentity ( ) ; $ this -> token_auth = $ result -> getTokenAuth ( ) ; // case the superUser is logged in if ( $ result -> hasSuperUserAccess ( ) ) { $ this -> setSuperUserAccess ( true ) ; } return true ; }
docstring: Loads the access levels for the current user.
  
  Calls the authentication method to try to log the user in the system.
  If the user credentials are not correct we don't load anything.
  If the login/password is correct the user is either the SuperUser or a normal user.
  We load the access levels for this user for all the websites.
  
  @param null|Auth $auth Auth adapter
  @return bool  true on success, false if reloading access failed (when auth object wasn't specified and user is not enforced to be Super User)
docstring_tokens: Loads the access levels for the current user .