/**
  * Authenticates an account by invoking the Provider based Authentication Manager.
  */
 public function authenticateAction()
 {
     try {
         $this->authenticationManager->authenticate();
         $this->addFlashMessage('You have successfully logged in.', 'Welcome', \TYPO3\FLOW3\Error\Message::SEVERITY_OK);
         $this->redirect('index', 'Overview');
     } catch (\TYPO3\FLOW3\Security\Exception\AuthenticationRequiredException $exception) {
         $this->addFlashMessage('Wrong username or password.', 'Login failed', \TYPO3\FLOW3\Error\Message::SEVERITY_ERROR);
         throw $exception;
     }
 }
 /**
  * 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.
  *
  * @return string
  */
 public function authenticateAction()
 {
     $authenticated = FALSE;
     try {
         $this->authenticationManager->authenticate();
         $authenticated = TRUE;
     } catch (\TYPO3\FLOW3\Security\Exception\AuthenticationRequiredException $exception) {
     }
     if ($authenticated) {
         $storedRequest = $this->securityContext->getInterceptedRequest();
         if ($storedRequest !== NULL) {
             $mainRequest = $storedRequest->getMainRequest();
             $packageKey = $mainRequest->getControllerPackageKey();
             $subpackageKey = $mainRequest->getControllerSubpackageKey();
             if ($subpackageKey !== NULL) {
                 $packageKey .= '\\' . $subpackageKey;
             }
             $this->redirect($mainRequest->getControllerActionName(), $mainRequest->getControllerName(), $packageKey, $mainRequest->getArguments());
         }
     } else {
         return call_user_func(array($this, $this->errorMethodName));
     }
 }
 /**
  * Authenticates an account by invoking the Provider based Authentication Manager.
  *
  * On successful authentication redirects to the list of posts, otherwise returns
  * to the login screen.
  *
  * @return void
  * @author Robert Lemke <*****@*****.**>
  */
 public function authenticateAction()
 {
     try {
         $this->authenticationManager->authenticate();
         if ($this->request->hasArgument("_redirect")) {
             $this->redirectToUri($this->request->getArgument("_redirect"));
         } else {
             $this->redirect('index', 'Standard');
         }
         $message = new \TYPO3\FLOW3\Error\Message('Successfully logged in');
         $this->flashMessageContainer->addMessage($message);
     } catch (\TYPO3\FLOW3\Security\Exception\AuthenticationRequiredException $exception) {
         $message = new \TYPO3\FLOW3\Error\Error('Wrong username or password.');
         $this->flashMessageContainer->addMessage($message);
         throw $exception;
     }
 }
 /**
  * Shows the specified node and takes visibility and access restrictions into
  * account.
  *
  * @param \TYPO3\TYPO3CR\Domain\Model\NodeInterface $node
  * @return string View output for the specified node
  */
 public function showWireframeAction(\TYPO3\TYPO3CR\Domain\Model\NodeInterface $node)
 {
     if (!$node->isAccessible()) {
         try {
             $this->authenticationManager->authenticate();
         } catch (\Exception $exception) {
         }
     }
     if (!$node->isAccessible() && !$this->nodeRepository->getContext()->isInaccessibleContentShown()) {
         $this->throwStatus(403);
     }
     if (!$node->isVisible() && !$this->nodeRepository->getContext()->isInvisibleContentShown()) {
         $this->throwStatus(404);
     }
     if ($node->getContentType() === 'TYPO3.Phoenix.ContentTypes:Shortcut') {
         $this->view->assign('wireframeMode', $node);
     }
     $this->nodeRepository->getContext()->setCurrentNode($node);
     $this->view->assign('value', $node);
     $this->view->setTypoScriptPath('wireframeMode');
     $this->response->setHeader('Cache-Control', 'public, s-maxage=600', FALSE);
 }
Exemple #5
0
 /**
  * Prepares the environment for and conducts an account authentication
  *
  * @param \TYPO3\FLOW3\Security\Account $account
  * @return void
  * @api
  */
 protected function authenticateAccount(\TYPO3\FLOW3\Security\Account $account)
 {
     $this->testingProvider->setAuthenticationStatus(\TYPO3\FLOW3\Security\Authentication\TokenInterface::AUTHENTICATION_SUCCESSFUL);
     $this->testingProvider->setAccount($account);
     $this->securityContext->clearContext();
     $requestHandler = self::$bootstrap->getActiveRequestHandler();
     $request = $requestHandler->getHttpRequest();
     $actionRequest = $request->createActionRequest();
     $this->securityContext->injectRequest($actionRequest);
     $this->authenticationManager->authenticate();
 }
Exemple #6
0
 /**
  * Invokes the security interception
  *
  * @return boolean TRUE if the security checks was passed
  * @throws \TYPO3\FLOW3\Security\Exception\AccessDeniedException
  */
 public function invoke()
 {
     $this->authenticationManager->authenticate();
     $this->accessDecisionManager->decideOnJoinPoint($this->joinPoint);
 }
 /**
  * Invokes the the authentication, if needed.
  *
  * @return boolean TRUE if the security checks was passed
  */
 public function invoke()
 {
     $this->authenticationManager->authenticate();
 }