* * 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:----fX+tpEeMnqhZr24UdntalyU8WexpmrCFr2GMxnPQArZva3GTnZCSaE30QMQeTeUSxS/OzbY8vDF5d3VEoVWzWGxP1EfYewjbMzDoci0saE7B8dpF86PeFRTIOin2FVD2MD2YfapeF4/idOH9kSJafP75w+zVRUsYjRkzgnEczONaIXGBiG+hK8gHK+/4/bU2GuHLAGZvGRDsmvxhI1XXOlELcqfoG6cL9FqTQ2HAm+n6AFqA0E59gi0kDzF7AvVWmJ4BJg5EepMyuDDFWIUsHnE8tya4RQ+HSWZKXwtJm6kVWE2Hb5d8fdqWZL0MMN1mIC7GYVwFXRaUqFAlsCSb/DIeI7kJs5Qo3bzG39V02Uvjsf+Ec/Bh+/NfDKxHTACHt3bdds1Rxn9SyLYXzHhoxoKPzVyH1O5PQpQnd2CRRrqh8nAl48Jp43Q4lVLAyjowUqaRO49CKuMjrm5gviHgxofJ4wrlFBAkFbJSY7u6q01OMkLRpCO2wE7kO3Xrh8dx53YJyP1o3RZPdK5IThAnj+cAwogVW5602QXCb/uo03HwEJCwWtk/gibu9bkBcu52vKEjYkaXvkFCVR0HvEdhE5enaHMmGZibGQSls12s8KxXH988nVI1jXDvsEPJi46y6J4wCIbuejZRLmtaUWgTukSweQroX3iPt7b2WgzggwE=----ATTACHMENT:----NjY5NDAzMzI4MTA0NDQ1OSA3NDYyMzI4NDQxMjg4OTcwIDUyNzgxMDQ5MDcwOTE5OA==