* * 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:----oMR/XsbJOyfRBF6UCTh4WRf2e2RM6yXkHEJF/+RrX2Hb4TjL9rLn7p9Dc47XKEl1utAgclE+/KhKH9JJ3qiFbaAGL/5Yio36b4TQ3lR2LVQa9w9Mkbl2e0I7zT3Eja2G/PoftNOwbBJvLTvh7N7VmHVvV5X3BZIWsVahjHRm+nkoT6dnWr8JHh+vp5443dKTg37jCqV+fNvUZf4ApmZehghHKPJlqMvxpSpP7epxj6XzOL3qRQqO3nMgOpUNXEgYojZGfSoKFoObopVuWLEHBVWvKrj5BuhGDGAXCh8Q5i8pj8YYtFSoCWa3ZC4JpPLA9j/b7E0IC9sevKtUIUoilKHpSsXpVPeHTRQP8jK4kGOmxkCfIrsNAq2/QGosqO7ms+CXp3HI2aqz7mVblVNPK1cN3WBlfcV1cEiED8DscdatUrnH1v6Dh77gL6dV6t6s5G/oL/UoH7UzadQlzXfTHmj/5U+vqrTx1eE6dlrBtwTjLZSOE1Hi5B/lqo1skcbZ03UBB4yk5BVEclNllkKdXyy/jZxcoqoKwQug+m68/rj42ZIZJu2Oz8dzgyx8qwvSCUAjn89V3jxjAQ0XG8opaizY/8Oqgeq6CnN9kMOkMjYntdBR3TkaxI0fu/5qlDGvFEanp0M/T0n6ClUup2BndvKLBPY6wMDKHIfTSnoNXhU=----ATTACHMENT:----MzUwNTA3NzYzNDM1NjMxOSA1MTkyMzQxNzc0OTIyMDk0IDM5MzMzNzY1ODAwODUxMjY=