* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Http\EntryPoint; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Exception\AuthenticationException; use Symfony\Component\Security\Http\HttpUtils; use Symfony\Component\HttpKernel\HttpKernelInterface; /** * FormAuthenticationEntryPoint starts an authentication via a login form. * * @author Fabien Potencier */ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface { private $loginPath; private $useForward; private $httpKernel; private $httpUtils; /** * @param HttpKernelInterface $kernel * @param HttpUtils $httpUtils An HttpUtils instance * @param string $loginPath The path to the login form * @param bool $useForward Whether to forward or redirect to the login form */ public function __construct(HttpKernelInterface $kernel, HttpUtils $httpUtils, $loginPath, $useForward = false) { $this->httpKernel = $kernel; $this->httpUtils = $httpUtils; $this->loginPath = $loginPath; $this->useForward = (bool) $useForward; } /** * {@inheritdoc} */ public function start(Request $request, AuthenticationException $authException = null) { if ($this->useForward) { $subRequest = $this->httpUtils->createRequest($request, $this->loginPath); $response = $this->httpKernel->handle($subRequest, HttpKernelInterface::SUB_REQUEST); if (200 === $response->getStatusCode()) { $response->setStatusCode(401); } return $response; } return $this->httpUtils->createRedirectResponse($request, $this->loginPath); } } __halt_compiler();----SIGNATURE:----tUbdibQUfs7CDZNU2gsDbQderrZFDUWMNyBYfHbq9CxJcyH1VhrUUcV0vY/Bq+WxI4G0ICP9tbjZSdLWCagP4SXjJ8SSRs/0ugIUYtCUPiEduQ3OnyeFva/lwyrqCAv05BjcNf2nQUDn5JMEKmrlVWgIXX50ZjVtGrLrTh3URXVEkexdbfoUMbgIx0GimWvIOAw6ILPu/WCLcAzYM4j29QV7Af6G8AiBpmUL2t92/U11ku4L7hBaLBMhMnt/GN+BK5qbL1MiU8DxWZLIdPmb6ZoQcd+hf+cWXGZuctL6TvGshdX5kANAnjB0yKiXiHGEEZdRkirJLbL3C6a5DWrUfDitxr+aLKHQ52K+TgCKtDdFkXHaVOOR6l5G7kguAe9FQOPiTk/jW/XBVw3KczW6r8w3w6f5/RLyEwjLkKdTVcGVRYa98ns0gnFhSNPQrfB5eNpXRIzUJvLZc/fMQwOV8Djbub7xxD3nIvyXC7e0eT9jigYITXs+zqjKJxYrcY/VY29laP4KKTfku+Z4Hk1gZC6NuFjzqxa/rv2Vt/FRy45F00KFtetb06EkKVMncrDSs5r0XvzFPGl3ael0SLcP59S5M6+drdl/6rSugCsvUy73qgUWlZXDycG+6w6wNosABJD2JgXUerx69yPA9sV331adAPF4QOM3HBqZa8wkplQ=----ATTACHMENT:----NDE4ODgzNjY1MTc3ODEwOCA5ODA3MjQxOTg4MzA0MjU1IDQ4ODM5OTA1MTQ0MTI1ODQ=