浏览代码

[FrameworkBundle] removed default controller for login

Fabien Potencier 14 年之前
父节点
当前提交
bdb051083c

+ 0 - 43
src/Symfony/Bundle/FrameworkBundle/Controller/SecurityController.php

@@ -1,43 +0,0 @@
-<?php
-
-namespace Symfony\Bundle\FrameworkBundle\Controller;
-
-use Symfony\Component\DependencyInjection\ContainerAware;
-use Symfony\Component\Security\SecurityContext;
-
-/*
- * This file is part of the Symfony framework.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
-
-/**
- * SecurityController.
- *
- * @author Fabien Potencier <fabien.potencier@symfony-project.com>
- */
-class SecurityController extends ContainerAware
-{
-    /**
-     * Displays the login form.
-     *
-     * @return Response A Response instance
-     */
-    public function loginAction()
-    {
-        $request = $this->container->get('request');
-        if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
-            $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
-        } else {
-            $error = $request->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
-        }
-
-        return $this->container->get('templating')->renderResponse('FrameworkBundle:Security:login.php', array(
-            'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),
-            'error'         => $error,
-        ));
-    }
-}

+ 0 - 12
src/Symfony/Bundle/FrameworkBundle/Resources/config/routing/security.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<routes xmlns="http://www.symfony-project.org/schema/routing"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.symfony-project.org/schema/routing http://www.symfony-project.org/schema/routing/routing-1.0.xsd">
-
-    <route id="_security_login" pattern="/login">
-        <default key="_controller">FrameworkBundle:Security:login</default>
-    </route>
-    <route id="_security_check" pattern="/login_check" />
-    <route id="_security_logout" pattern="/logout" />
-</routes>

+ 0 - 13
src/Symfony/Bundle/FrameworkBundle/Resources/views/Security/login.php

@@ -1,13 +0,0 @@
-<?php if ($error): ?>
-    <div><?php echo $error ?></div>
-<?php endif; ?>
-
-<form action="<?php echo $view['router']->generate('_security_check') ?>" method="post">
-    <label for="username">Username:</label>
-
-    <input type="text" id="username" name="_username" value="<?php echo $last_username ?>" />
-    <label for="password">Password:</label>
-    <input type="password" id="password" name="_password" />
-
-    <input type="submit" name="login" />
-</form>