Overview

Namespaces

  • Mapbender
    • Component
      • HTTP
    • CoreBundle
      • Command
      • Component
        • Exception
      • Controller
      • DataFixtures
        • ORM
      • DependencyInjection
      • Element
        • Type
      • Entity
      • EventListener
      • Extension
      • Form
        • DataTransformer
        • EventListener
        • Type
      • Security
      • Template
    • KmlBundle
      • Element
    • ManagerBundle
      • Controller
      • Form
        • DataTransformer
        • Type
    • MonitoringBundle
      • Command
      • Component
      • Controller
      • DependencyInjection
      • Entity
      • EventListener
      • Form
    • PrintBundle
      • Component
      • Controller
    • WmcBundle
      • Component
        • Exception
      • Element
        • Type
      • Entity
      • Form
        • Type
    • WmsBundle
      • Component
        • Exception
      • Controller
      • DependencyInjection
      • Element
        • Type
      • Entity
      • Event
      • Form
        • EventListener
        • Type
    • WmtsBundle
      • Component
        • Exception
      • Controller
      • Entity
      • Form
        • Type
  • None
  • PHP

Classes

  • CustomDoctrineParamConverter
  • Ldap
  • UrlHelper
  • UrlSessionFormEntryPoint
  • UrlSessionLoginHandler
  • UrlSessionRedirectListener
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download
 1: <?php
 2: namespace Mapbender\Component;
 3: 
 4: use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
 5: use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
 6: use Symfony\Component\HttpFoundation\Request;
 7: use Symfony\Component\HttpFoundation\RedirectResponse;
 8: 
 9: class UrlSessionLoginHandler implements AuthenticationSuccessHandlerInterface {
10:     /**
11:      * Constructor
12:      * @param RouterInterface   $router
13:      * @param EntityManager     $em
14:      */
15:    public function __construct(array $options = array()) {}
16: 
17:     /**
18:      * This is called when an interactive authentication attempt succeeds.
19:      * This version takes care of injecting the right SID into the URL for
20:      * cookie-less environments.
21:      *
22:      * @param Request        $request
23:      * @param TokenInterface $token
24:      * @return Response The response to return
25:      */
26:     function onAuthenticationSuccess(Request $request, TokenInterface $token) {
27:         $session = $request->getSession();
28: 
29:         $url = $session->get('_security.target_path');
30:         $session->remove('_security.target_path');
31: 
32:         $url = UrlHelper::setParameters($url, array(
33:             session_name() => $session->getId()));
34: 
35:         return new RedirectResponse($url);
36:    }
37: }
38: 
Mapbender3 API documenation API documentation generated by ApiGen 2.8.0