Finalized admin security
This commit is contained in:
@@ -11,11 +11,13 @@
|
||||
<parameter key="deleteArticle">Thelia\Core\Event\CartEvent</parameter>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
||||
<services>
|
||||
|
||||
<service id="thelia.action.cart" class="Thelia\Action\Cart">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
<service id="thelia.action.customer" class="Thelia\Action\Customer">
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
|
||||
@@ -49,15 +49,23 @@
|
||||
<!--
|
||||
A ControllerResolver that supports "a:b:c", "service:method" and class::method" notations,
|
||||
thus allowing the definition of controllers as service (see http://symfony.com/fr/doc/current/cookbook/controller/service.html)
|
||||
We use it here to inject the servi ce container in the admin base controller.
|
||||
We use it here to inject the service container in the admin base controller.
|
||||
-->
|
||||
<service id="controller_resolver" class="Thelia\Core\Controller\ControllerResolver">
|
||||
<argument type="service" id="service_container"/>
|
||||
</service>
|
||||
|
||||
<!-- Security -->
|
||||
<!-- Translation and internationalisation -->
|
||||
|
||||
<service id="thelia.security" class="Thelia\Core\Security\SecurityContext" />
|
||||
<service id="thelia.translator" class="Thelia\Core\Translation\Translator">
|
||||
<argument type="string" id="en_US"></argument>
|
||||
</service>
|
||||
|
||||
<!-- Security context for front and back office -->
|
||||
|
||||
<service id="thelia.securityContext" class="Thelia\Core\Security\SecurityContext" scope="request">
|
||||
<argument type="service" id="request" />
|
||||
</service>
|
||||
|
||||
<!-- Parser configuration -->
|
||||
|
||||
@@ -84,7 +92,7 @@
|
||||
|
||||
<argument type="service" id="request" />
|
||||
<argument type="service" id="event_dispatcher"/>
|
||||
<argument type="service" id="thelia.security"/>
|
||||
<argument type="service" id="thelia.securityContext"/>
|
||||
|
||||
<call method="setLoopList">
|
||||
<argument>%thelia.parser.loops%</argument>
|
||||
@@ -102,15 +110,16 @@
|
||||
|
||||
<service id="smarty.plugin.translation" class="Thelia\Core\Template\Smarty\Plugins\Translation" >
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
<argument type="service" id="thelia.translator" />
|
||||
</service>
|
||||
|
||||
<service id="smarty.plugin.module" class="Thelia\Core\Template\Smarty\Plugins\Module" >
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
</service>
|
||||
|
||||
<service id="smarty.plugin.security" class="Thelia\Core\Template\Smarty\Plugins\Security" >
|
||||
<service id="smarty.plugin.security" class="Thelia\Core\Template\Smarty\Plugins\Security" scope="request">
|
||||
<tag name="thelia.parser.register_plugin"/>
|
||||
<argument type="service" id="thelia.security" />
|
||||
<argument type="service" id="thelia.securityContext" />
|
||||
</service>
|
||||
|
||||
<service id="http_kernel" class="Thelia\Core\TheliaHttpKernel">
|
||||
|
||||
@@ -4,14 +4,28 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
|
||||
<!-- Route to administration base -->
|
||||
<route id="admin" path="/admin">
|
||||
<default key="_controller">Thelia\Admin\Controller\AdminController::indexAction</default>
|
||||
</route>
|
||||
|
||||
<!-- Route to the administration login page -->
|
||||
<route id="admin.login" path="/admin/login">
|
||||
<default key="_controller">Thelia\Admin\Controller\SessionController::loginAction</default>
|
||||
<default key="_controller">Thelia\Admin\Controller\SessionController::showLoginAction</default>
|
||||
</route>
|
||||
<route id="admin.notfound" path="/admin/{everything}">
|
||||
<default key="_controller">Thelia\Admin\Controller\AdminController::notFoundAction</default>
|
||||
|
||||
<!-- Route to the administration logout page -->
|
||||
<route id="admin.logout" path="/admin/logout">
|
||||
<default key="_controller">Thelia\Admin\Controller\SessionController::checkLogoutAction</default>
|
||||
</route>
|
||||
|
||||
<!-- Route to the login check controller -->
|
||||
<route id="admin.checklogin" path="/admin/checklogin">
|
||||
<default key="_controller">Thelia\Admin\Controller\SessionController::checkLoginAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.undefined" path="/admin/{everything}">
|
||||
<default key="_controller">Thelia\Admin\Controller\AdminController::undefinedAction</default>
|
||||
<requirement key="everything">.*</requirement>
|
||||
</route>
|
||||
</routes>
|
||||
Reference in New Issue
Block a user