* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\Firewall; use Symfony\Component\Security\Http\AccessMapInterface; use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface; use Psr\Log\LoggerInterface; use Symfony\Component\HttpKernel\Event\GetResponseEvent; /** * ChannelListener switches the HTTP protocol based on the access control * configuration. * * @author Fabien Potencier */ class ChannelListener implements ListenerInterface { private $map; private $authenticationEntryPoint; private $logger; public function __construct(AccessMapInterface $map, AuthenticationEntryPointInterface $authenticationEntryPoint, LoggerInterface $logger = null) { $this->map = $map; $this->authenticationEntryPoint = $authenticationEntryPoint; $this->logger = $logger; } /** * Handles channel management. */ public function handle(GetResponseEvent $event) { $request = $event->getRequest(); list(, $channel) = $this->map->getPatterns($request); if ('https' === $channel && !$request->isSecure()) { if (null !== $this->logger) { $this->logger->info('Redirecting to HTTPS.'); } $response = $this->authenticationEntryPoint->start($request); $event->setResponse($response); return; } if ('http' === $channel && $request->isSecure()) { if (null !== $this->logger) { $this->logger->info('Redirecting to HTTP.'); } $response = $this->authenticationEntryPoint->start($request); $event->setResponse($response); } } } __halt_compiler();----SIGNATURE:----B2jtsyaF7OE7zKOBU/zrVCW2zTZ4Lpsc1UImdFTaUO7oexp7dU1I3iZ94yEknpk23jmHPLx7tyHVgNh47YXVYY2zoNdM/VlQHJEVEPFSsS3O7GB5IjCg4fz2ea41tuTfbrNqwLd/6E9a8F6jR9KOgHuK84JpJCue5ajhVjQACrye4LjVQM1hQKR0TSCOEFgyPp77uY7EMWq5wSfFqL2QjgUY1bBHIqMolqPxxjJRfPxG0KNKiLlTEkIdqy0Jjo/6YKWvEamv9UG2n32iC2sSfo1TsnqR9maQ18DyV+yzR3zZeBMAwWGAP8SeVEnMyyzHs8V/ngKPPZwxrT3LfDVE7KpHZ/eXqKQgRuP8J+DmOMV/R0I8kXHQkz5BNMKiE7b27vpYeeHaYluZR7mqN9Vxc8Cg8Ut0WZfOc+aIBzSZbaPEomS+pnX9e3uKOM69n1R//8K2eonWedgfuikAW02ZWZwktc9SLgMTt/W1xua3r+bctzcCk9KbxswZP+PqbTEwSOS4cbR9Xl9BMhF7IyumsS066kZQMSBSQQPVU/QOyqmNK8z+gazvUcJoROomVOgPOht9V+DeVn+VI4MHulViRhJ7qrdHcd3zdghTNVS5s5nbc/oppR9kMbbk6HJ6uLIOKBsmftzDppjrXE5n6SmYniixXZ1VfRJ13jiRSzcgcgQ=----ATTACHMENT:----Mjk0MTIyNzEyMjk5OTAxMiAxMzkxMTY5NTQxODEwMDMxIDczNzg2MDAxNTkxMjE5NDM=