Example #1
0
 /**
  * First step in the Google authentication process.
  * @return Redirection
  */
 private function getStartGoogleAuthenticationResponse()
 {
     $response = new Redirection($this->getRequest());
     $currentUser = Users::getCurrent();
     try {
         // Set up the redirection to Google's authentication URL.
         $identityProvider = new GoogleIdentityProvider();
         $response->setNextUrl($identityProvider->getAuthenticationUrl());
     } catch (AuthenticationException $exception) {
         $response->setErrorMessage('Google authentication did not succeed.');
         $response->setNextUrl($this->getRequest()->getCurrentUrl());
     }
     return $response;
 }
Example #2
0
 public function issue()
 {
     $this->setNextUrl($this->getRequest()->getCurrentUrl());
     parent::issue();
 }
Example #3
0
 /**
  * Gets a redirection to the collection's index page, honouring the current
  * view.
  */
 private function getIndexRedirectionResponse()
 {
     $response = new Redirection($this->getRequest());
     $url = sprintf('/%s/', $this->getCollectionName());
     // If a particular view was being shown, honour it.
     $view = $this->getRequest()->getParameter('view');
     if (!empty($view)) {
         $url .= '?view=' . $view;
     }
     $response->setNextUrl($url);
     return $response;
 }