/**
  * return void
  */
 public function logoutAction()
 {
     parent::logoutAction();
     $uri = $this->request->getInternalArgument('__redirectAfterLogoutUri');
     if (empty($uri)) {
         $this->redirect('index');
     } else {
         $this->redirectToUri($uri);
     }
 }
 /**
  *
  */
 public function logoutAction()
 {
     parent::logoutAction();
     if ($this->request->getFormat() === 'json') {
         $this->response->setHeader('Content-Type', 'application/json', TRUE);
         $this->response->setContent('null');
         throw new \TYPO3\Flow\Mvc\Exception\StopActionException();
     } elseif ($this->request->getFormat() === 'html') {
         $returnTo = $this->getReturnTo();
         $this->redirectToUri($returnTo);
     }
 }
 /**
  * Calls the authentication manager to authenticate all active tokens
  * and redirects to the original intercepted request on success if there
  * is one stored in the security context. If no intercepted request is
  * found, the function simply returns.
  *
  * If authentication fails, the result of calling the defined
  * $errorMethodName is returned.
  *
  * Note: Usually there is no need to override this action. You should use
  * the according callback methods instead (onAuthenticationSuccess() and
  * onAuthenticationFailure()).
  *
  * @return string
  *
  * @todo Make example Fluid form for Pretty Redirect Page. Maybe JS function with 5, 4, 3, 2, 1 -> redirect with fallback for non JS Browser.
  */
 public function authenticateAction()
 {
     if (!$this->request->hasArgument('casProviderName')) {
         return parent::authenticateAction();
     }
     $providerName = $this->request->getArgument('casProviderName');
     $referer = $this->catchReferer($providerName);
     if ($this->definePrettyPreRedirectTemplate($providerName)) {
         $this->view->assignMultiple(['referer' => $referer, '__casAuthenticationProviderName' => $providerName]);
     } else {
         $this->redirect('casAuthentication', null, null, ['__casAuthenticationProviderName' => $providerName]);
     }
 }
예제 #4
0
 /**
  * Logs all active tokens out.
  */
 public function logoutAction()
 {
     parent::logoutAction();
     $result = $this->redirectTargetService->onLogout($this->controllerContext);
     if (is_string($result)) {
         // This might be an issue in Neos; when embedding this as a plugin on a login-protected page that is no longer visible after logout.
         // It seems that $this->redirectToUri() does not work, because the parent response is still rendered (which leads to exceptions).
         // So we build our own version of redirectToUri() and die() afterwards to prevent the response bubbling.
         $escapedUri = htmlentities($result, ENT_QUOTES, 'utf-8');
         header('Location: ' . $escapedUri);
         header('Status: ' . 303);
         echo '<html><head><meta http-equiv="refresh" content="' . intval(0) . ';url=' . $escapedUri . '"/></head></html>';
         die;
     } elseif ($result instanceof ActionRequest) {
         $this->redirectToRequest($result);
     }
     if ($result === null) {
         // Default: redirect to login
         $this->redirect('login');
     } else {
         throw new Exception('RedirectTargetServiceInterface::onLogout must return either null, an URL string or an ActionRequest object, but was: ' . gettype($result) . ' - ' . get_class($result), 1464164500);
     }
 }
 /**
  * Overridden authenticateAction method to check for an existing account with the Opauth data.
  *
  * @return string
  */
 public function authenticateAction()
 {
     $opauthResponse = $this->opauth->getResponse();
     if ($this->authenticateActionAlreadyCalled == FALSE && $opauthResponse !== NULL) {
         $this->authenticateActionAlreadyCalled = TRUE;
         if ($opauthResponse->isAuthenticationSucceeded()) {
             $opauthAccount = $this->opauthAccountService->getAccount($opauthResponse);
             $doesAccountExists = $this->opauthAccountService->doesAccountExist($opauthAccount);
             if ($doesAccountExists === FALSE) {
                 return $this->onOpauthAccountDoesNotExist($opauthResponse->getRawData(), $opauthAccount);
             }
         } else {
             return $this->onOpauthAuthenticationFailure($opauthResponse->getRawData());
         }
     }
     return parent::authenticateAction();
 }
 /**
  * Logs out a - possibly - currently logged in account.
  * The possible redirection URI is queried from the redirection service
  * at first, before the actual logout takes place, and the session gets destroyed.
  *
  * @return void
  */
 public function logoutAction()
 {
     $possibleRedirectionUri = $this->backendRedirectionService->getAfterLogoutRedirectionUri($this->request);
     parent::logoutAction();
     switch ($this->request->getFormat()) {
         case 'json':
             $this->view->assign('value', array('success' => true));
             break;
         default:
             if ($possibleRedirectionUri !== null) {
                 $this->redirectToUri($possibleRedirectionUri);
             }
             $this->addFlashMessage('Successfully logged out', 'Logged out', Message::SEVERITY_NOTICE, array(), 1318421560);
             $this->redirect('index');
     }
 }
예제 #7
0
 /**
  * Logs out a - possibly - currently logged in account.
  *
  * @return void
  */
 public function logoutAction()
 {
     parent::logoutAction();
     switch ($this->request->getFormat()) {
         default:
             $this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Message('Successfully logged out.', 1318421560));
             $this->redirect('index');
             break;
     }
 }
 /**
  * return void
  */
 public function logoutAction()
 {
     parent::logoutAction();
     $this->addFlashMessage('Successfully logged out', 'Logged out', Message::SEVERITY_NOTICE);
     $this->redirect('index');
 }
 /**
  * @return void
  */
 public function logoutAction()
 {
     parent::logoutAction();
     $this->redirect('index', 'Landing', NULL, array('loggedOut' => TRUE));
 }
 /**
  * Do logout - will invalidate the account in the login-session and redirect.
  */
 public function logoutAction()
 {
     parent::logoutAction();
     $this->redirect('index', 'quiz');
 }
 /**
  * Logs all active tokens out and redirects the user to the login form
  *
  * @return void
  */
 public function logoutAction()
 {
     parent::logoutAction();
     $this->addFlashMessage('Logout successful');
     $this->redirect('index');
 }