diff --git a/core/lib/Thelia/Action/Cart.php b/core/lib/Thelia/Action/Cart.php index 5d85f774f..c06ade935 100755 --- a/core/lib/Thelia/Action/Cart.php +++ b/core/lib/Thelia/Action/Cart.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Action/Customer.php b/core/lib/Thelia/Action/Customer.php index 09c3246fd..0d95b54be 100755 --- a/core/lib/Thelia/Action/Customer.php +++ b/core/lib/Thelia/Action/Customer.php @@ -32,9 +32,33 @@ use Thelia\Form\CustomerModification; use Thelia\Model\Customer as CustomerModel; use Thelia\Log\Tlog; use Thelia\Model\CustomerQuery; +use Thelia\Form\CustomerLogin; +use Thelia\Core\Security\Authentication\CustomerUsernamePasswordFormAuthenticator; +use Thelia\Core\Security\SecurityContext; +use Thelia\Model\ConfigQuery; +use Thelia\Tools\Redirect; +use Symfony\Component\Validator\Exception\ValidatorException; +use Thelia\Core\Security\Exception\AuthenticationException; class Customer implements EventSubscriberInterface { + /** + * @var Thelia\Core\Security\SecurityContext + */ + private $securityContext; + + public function __construct(SecurityContext $context) { + $this->securityContext = $context; + + $context->setContext(SecurityContext::CONTEXT_FRONT_OFFICE); + } + + + private function getSecurityContext($context) { + $this->securityContext->setContext($context === false ? SecurityContext::CONTEXT_FRONT_OFFICE : $context); + + return $securityContext; + } public function create(ActionEvent $event) { @@ -48,6 +72,7 @@ class Customer implements EventSubscriberInterface $form = $customerCreation->getForm(); if ($request->isMethod("post")) { + $form->bind($request); if ($form->isValid()) { @@ -76,7 +101,8 @@ class Customer implements EventSubscriberInterface //Customer is create, he is automatically connected - } else { + } + else { $event->setFormError($customerCreation); } @@ -125,7 +151,56 @@ class Customer implements EventSubscriberInterface } - public function modifyPassword(ActionEvent $event) + /** + * Perform user login. On a successful login, the user is redirected to the URL + * found in the success_url form parameter, or / if none was found. + * + * If login is not successfull, the same view is dispolyed again. + * + * @param ActionEvent $event + */ + public function login(ActionEvent $event) + { + $request = $event->getRequest(); + + $form = new CustomerLogin($request); + + $authenticator = new CustomerUsernamePasswordFormAuthenticator($request, $form); + + try { + $user = $authenticator->getAuthentifiedUser(); + + // Success -> store user in security context + $this->getSecurityContext()->setUser($user); + + // Log authentication success + AdminLog::append("Authentication successufull", $request, $user); + + // Get the success URL to redirect the user to + $successUrl = $form->getForm()->get('success_url')->getData(); + + if (null == $successUrl) $successUrl = ConfigQuery::read('base_url', '/'); + + // Redirect to the success URL + return Redirect::exec(URL::absoluteUrl($successUrl)); + } + catch (ValidatorException $ex) { + $message = "Missing or invalid information. Please check your input."; + } + catch (AuthenticationException $ex) { + $message = "Login failed. Please check your username and password."; + } + catch (\Exception $ex) { + $message = sprintf("Unable to process your request. Please try again (%s).", $ex->getMessage()); + } + + // Store the form name in session (see Form Smarty plugin to find usage of this parameter) + $request->getSession()->setErrorFormName($form->getName()); + + // A this point, the same view is displayed again. + } + + public function changePassword(ActionEvent $event) { } @@ -154,7 +229,8 @@ class Customer implements EventSubscriberInterface { return array( "action.createCustomer" => array("create", 128), - "action.modifyCustomer" => array("modify", 128) + "action.modifyCustomer" => array("modify", 128), + "action.loginCustomer" => array("login", 128) ); } diff --git a/core/lib/Thelia/Admin/Controller/AdminController.php b/core/lib/Thelia/Admin/Controller/AdminController.php index 1b5212cd2..57421825e 100755 --- a/core/lib/Thelia/Admin/Controller/AdminController.php +++ b/core/lib/Thelia/Admin/Controller/AdminController.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ diff --git a/core/lib/Thelia/Admin/Controller/BaseAdminController.php b/core/lib/Thelia/Admin/Controller/BaseAdminController.php index 15a9753f3..773f9cccc 100755 --- a/core/lib/Thelia/Admin/Controller/BaseAdminController.php +++ b/core/lib/Thelia/Admin/Controller/BaseAdminController.php @@ -35,6 +35,7 @@ use Thelia\Model\ConfigQuery; use Thelia\Core\Security\Exception\AuthenticationException; use Thelia\Core\Security\SecurityContext; use Thelia\Tools\URL; +use Thelia\Tools\Redirect; /** * @@ -94,7 +95,7 @@ class BaseAdminController extends ContainerAware // User is not authenticated, and templates requires authentication -> redirect to login page // (see Thelia\Core\Template\Smarty\Plugins\Security) - return new RedirectResponse(URL::absoluteUrl('admin/login')); // FIXME shoud be a parameter + Redirect::exec(URL::absoluteUrl('admin/login')); // FIXME shoud be a parameter } } @@ -172,17 +173,4 @@ class BaseAdminController extends ContainerAware return $this->container->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); } - - /** - * Returns a RedirectResponse to the given URL. - * - * @param string $url The URL to redirect to - * @param integer $status The status code to use for the Response - * - * @return RedirectResponse - */ - protected function redirect($url, $status = 302) - { - return new RedirectResponse($url, $status); - } } \ No newline at end of file diff --git a/core/lib/Thelia/Admin/Controller/SessionController.php b/core/lib/Thelia/Admin/Controller/SessionController.php index 457b6798e..d2febe089 100755 --- a/core/lib/Thelia/Admin/Controller/SessionController.php +++ b/core/lib/Thelia/Admin/Controller/SessionController.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -25,15 +25,12 @@ namespace Thelia\Admin\Controller; use Symfony\Component\HttpFoundation\Response; use Thelia\Form\AdminLogin; -use Thelia\Core\Security\Token\UsernamePasswordToken; -use Thelia\Core\Security\Authentication\UsernamePasswordAuthenticator; -use Thelia\Core\Security\Encoder\PasswordPhpCompatEncoder; -use Thelia\Core\Security\Token\TokenInterface; use Thelia\Core\Security\Authentication\AdminUsernamePasswordFormAuthenticator; use Thelia\Model\AdminLog; use Thelia\Core\Security\Exception\AuthenticationException; use Symfony\Component\Validator\Exception\ValidatorException; use Thelia\Tools\URL; +use Thelia\Tools\Redirect; class SessionController extends BaseAdminController { @@ -47,7 +44,7 @@ class SessionController extends BaseAdminController { $this->getSecurityContext()->clear(); // Go back to login page. - return $this->redirect(URL::absoluteUrl('admin/login')); + return Redirect::exec(URL::absoluteUrl('admin/login')); } public function checkLoginAction() @@ -72,11 +69,12 @@ class SessionController extends BaseAdminController { if (null == $successUrl) $successUrl = 'admin/home'; - // Redirect to home page - FIXME: requested URL, if we come from another page ? - return $this->redirect(URL::absoluteUrl($successUrl)); + // Redirect to the success URL + return Redirect::exec(URL::absoluteUrl($successUrl)); } catch (ValidatorException $ex) { + // Validation problem $message = "Missing or invalid information. Please check your input."; } catch (AuthenticationException $ex) { @@ -86,19 +84,20 @@ class SessionController extends BaseAdminController { $message = "Login failed. Please check your username and password."; } + catch (\Exception $ex) { - // Store the form in session (see Form Smlarty plugin to find usage of this parameter) + // Log authentication failure + AdminLog::append(sprintf("Undefined error: %s", $ex->getMessage()), $request); + + $message = "Unable to process your request. Please try again."; + } + + // Store the form name in session (see Form Smarty plugin to find usage of this parameter) $request->getSession()->setErrorFormName($form->getName()); - if (empty($failureUrl)) { - // Display the login form again, with an error message if required - return $this->render("login.html", array( - "message" => $message - )); - } - else { - // Redirect to the provided URL - return $this->redirect(URL::absoluteUrl($failureUrl)); - } + // Display the login form again, with an error message if required + return $this->render("login.html", array( + "message" => $message + )); } } \ No newline at end of file diff --git a/core/lib/Thelia/Command/CacheClear.php b/core/lib/Thelia/Command/CacheClear.php index eba228da8..485f479ce 100755 --- a/core/lib/Thelia/Command/CacheClear.php +++ b/core/lib/Thelia/Command/CacheClear.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Command/ContainerAwareCommand.php b/core/lib/Thelia/Command/ContainerAwareCommand.php index abd8f9960..2dc455edb 100755 --- a/core/lib/Thelia/Command/ContainerAwareCommand.php +++ b/core/lib/Thelia/Command/ContainerAwareCommand.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Command/Install.php b/core/lib/Thelia/Command/Install.php index 53a573375..48903c2a0 100755 --- a/core/lib/Thelia/Command/Install.php +++ b/core/lib/Thelia/Command/Install.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Command/ModuleGenerateModelCommand.php b/core/lib/Thelia/Command/ModuleGenerateModelCommand.php index 348765ced..a42cb9065 100644 --- a/core/lib/Thelia/Command/ModuleGenerateModelCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateModelCommand.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php b/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php index 977075902..95ee7a931 100644 --- a/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php +++ b/core/lib/Thelia/Command/ModuleGenerateSqlCommand.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php b/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php index aa0a8a1e7..667a18087 100644 --- a/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php +++ b/core/lib/Thelia/Command/Output/TheliaConsoleOutput.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Command/Skeleton/Module/Class.php b/core/lib/Thelia/Command/Skeleton/Module/Class.php index ccf061a48..ecf67646d 100644 --- a/core/lib/Thelia/Command/Skeleton/Module/Class.php +++ b/core/lib/Thelia/Command/Skeleton/Module/Class.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Config/DatabaseConfiguration.php b/core/lib/Thelia/Config/DatabaseConfiguration.php index 376c16609..16d273738 100755 --- a/core/lib/Thelia/Config/DatabaseConfiguration.php +++ b/core/lib/Thelia/Config/DatabaseConfiguration.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Config/DefinePropel.php b/core/lib/Thelia/Config/DefinePropel.php index 06d33ebfc..434187144 100755 --- a/core/lib/Thelia/Config/DefinePropel.php +++ b/core/lib/Thelia/Config/DefinePropel.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Config/Resources/action.xml b/core/lib/Thelia/Config/Resources/action.xml index 5d4436891..1fd380425 100755 --- a/core/lib/Thelia/Config/Resources/action.xml +++ b/core/lib/Thelia/Config/Resources/action.xml @@ -11,15 +11,16 @@ Thelia\Core\Event\CartEvent - + - - + + + diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index b91428f6c..4315d2844 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -11,19 +11,6 @@ - - - - - - - - -
diff --git a/core/lib/Thelia/Controller/DefaultController.php b/core/lib/Thelia/Controller/DefaultController.php index 2c8a4ca62..646d3b27a 100755 --- a/core/lib/Thelia/Controller/DefaultController.php +++ b/core/lib/Thelia/Controller/DefaultController.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Controller; diff --git a/core/lib/Thelia/Core/Application.php b/core/lib/Thelia/Core/Application.php index b6b07614c..531d8802c 100755 --- a/core/lib/Thelia/Core/Application.php +++ b/core/lib/Thelia/Core/Application.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php index 786093e15..9f7e9f31f 100755 --- a/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php +++ b/core/lib/Thelia/Core/DependencyInjection/Compiler/RegisterListenersPass.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php b/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php index 8de39f095..a95e7d668 100755 --- a/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php +++ b/core/lib/Thelia/Core/DependencyInjection/Loader/XmlFileLoader.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Event/ActionEvent.php b/core/lib/Thelia/Core/Event/ActionEvent.php index fc5822a93..486b80ee8 100755 --- a/core/lib/Thelia/Core/Event/ActionEvent.php +++ b/core/lib/Thelia/Core/Event/ActionEvent.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ @@ -26,6 +26,7 @@ namespace Thelia\Core\Event; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\HttpFoundation\Request; use Thelia\Form\BaseForm; +use Thelia\Core\Security\SecurityContext; /** * * Class thrown on Thelia.action event @@ -107,5 +108,4 @@ abstract class ActionEvent extends Event { return $this->form !== null; } - } diff --git a/core/lib/Thelia/Core/Event/CustomRefEvent.php b/core/lib/Thelia/Core/Event/CustomRefEvent.php index 15113c218..000f46153 100755 --- a/core/lib/Thelia/Core/Event/CustomRefEvent.php +++ b/core/lib/Thelia/Core/Event/CustomRefEvent.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\Event; diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index aca4e106a..46dd89ee6 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/EventListener/ControllerListener.php b/core/lib/Thelia/Core/EventListener/ControllerListener.php index 96d249e69..3ae9c77bb 100755 --- a/core/lib/Thelia/Core/EventListener/ControllerListener.php +++ b/core/lib/Thelia/Core/EventListener/ControllerListener.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\EventListener; @@ -29,7 +29,7 @@ use Thelia\Core\Factory\ActionEventFactory; /** * - * Action are dispatch here. + * Action are dispatched here. * * A factory is used for creating appropriate action object * @@ -43,6 +43,7 @@ class ControllerListener implements EventSubscriberInterface { $dispatcher = $event->getDispatcher(); $request = $event->getRequest(); + if (false !== $action = $request->get("action")) { //search corresponding action $event = new ActionEventFactory($request, $action, $event->getKernel()->getContainer()->getParameter("thelia.actionEvent")); @@ -53,7 +54,6 @@ class ControllerListener implements EventSubscriberInterface $request->getSession()->setErrorFormName($actionEvent->getFormError()->getName()); } } - } public static function getSubscribedEvents() diff --git a/core/lib/Thelia/Core/EventListener/ViewListener.php b/core/lib/Thelia/Core/EventListener/ViewListener.php index 50acd044d..a67d7f0e2 100755 --- a/core/lib/Thelia/Core/EventListener/ViewListener.php +++ b/core/lib/Thelia/Core/EventListener/ViewListener.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\EventListener; @@ -30,6 +30,9 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Thelia\Core\Template\Exception\ResourceNotFoundException; use Thelia\Core\Template\ParserInterface; +use Thelia\Tools\Redirect; +use Thelia\Tools\URL; +use Thelia\Core\Security\Exception\AuthenticationException; /** * @@ -78,10 +81,17 @@ class ViewListener implements EventSubscriberInterface } else { $event->setResponse(new Response($content, $parser->getStatus() ?: 200)); } - } catch (ResourceNotFoundException $e) { + } + catch (ResourceNotFoundException $e) { $event->setResponse(new Response($e->getMessage(), 404)); } + catch (AuthenticationException $ex) { + // Redirect to the login template + $event->setResponse(Redirect::exec(URL::viewUrl($ex->getLoginTemplate()))); + } + + throw new \Exception("toto !"); } public function beforeKernelView(GetResponseForControllerResultEvent $event) diff --git a/core/lib/Thelia/Core/Factory/ActionEventFactory.php b/core/lib/Thelia/Core/Factory/ActionEventFactory.php index 7cda0a083..af41edecd 100755 --- a/core/lib/Thelia/Core/Factory/ActionEventFactory.php +++ b/core/lib/Thelia/Core/Factory/ActionEventFactory.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php index 564c4b1c6..bf47310b2 100755 --- a/core/lib/Thelia/Core/HttpFoundation/Session/Session.php +++ b/core/lib/Thelia/Core/HttpFoundation/Session/Session.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ @@ -26,9 +26,11 @@ namespace Thelia\Core\HttpFoundation\Session; use Symfony\Component\HttpFoundation\Session\Session as BaseSession; use Thelia\Core\Security\User\UserInterface; use Thelia\Form\BaseForm; +use Thelia\Model\ConfigQuery; class Session extends BaseSession { + // -- Language ------------------------------------------------------------ public function getLocale() { @@ -40,6 +42,8 @@ class Session extends BaseSession { return substr($this->getLocale(), 0, 2); } + // -- Customer user -------------------------------------------------------- + public function setCustomerUser(UserInterface $user) { $this->set('customer_user', $user); @@ -55,6 +59,7 @@ class Session extends BaseSession { return $this->remove('customer_user'); } + // -- Admin user ----------------------------------------------------------- public function setAdminUser(UserInterface $user) { @@ -71,6 +76,8 @@ class Session extends BaseSession { return $this->remove('admin_user'); } + // -- Error form ----------------------------------------------------------- + /** * @param string $formName the form name */ @@ -88,4 +95,21 @@ class Session extends BaseSession { { return $this->remove('error_form'); } + + // -- Return page ---------------------------------------------------------- + + public function setReturnToUrl($url) + { + $this->set('return_to_url', $url); + } + + /** + * + * @return the return-to URL, or the index page if none is defined. + */ + public function getReturnToUrl() + { + return $this->get('return_to_url', ConfigQuery::read('base_url')); + } + } diff --git a/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php b/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php index 8f3836119..1097edf5a 100644 --- a/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php +++ b/core/lib/Thelia/Core/Security/Authentication/CustomerUsernamePasswordFormAuthenticator.php @@ -27,6 +27,7 @@ namespace Thelia\Core\Security\Authentication; use Symfony\Component\HttpFoundation\Request; use Thelia\Core\Security\Authentication\UsernamePasswordFormAuthenticator; use Thelia\Form\CustomerLogin; +use Thelia\Core\Security\UserProvider\CustomerUserProvider; class CustomerUsernamePasswordFormAuthenticator extends UsernamePasswordFormAuthenticator { diff --git a/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php b/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php index 2e3e496a3..ad0e01a3b 100644 --- a/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php +++ b/core/lib/Thelia/Core/Security/Exception/AuthenticationException.php @@ -25,4 +25,24 @@ namespace Thelia\Core\Security\Exception; class AuthenticationException extends \Exception { + /** + * @var string The login template name + */ + protected $loginTemplate = "login"; + + /** + * @return string the login template name + */ + public function getLoginTemplate() { + return $this->loginTemplate; + } + + /** + * Set the login template name + * + * @param string $loginPath the login template name + */ + public function setLoginTemplate($loginTemplate) { + $this->loginTemplate = $loginTemplate; + } } diff --git a/core/lib/Thelia/Core/Security/Role/Role.php b/core/lib/Thelia/Core/Security/Role/Role.php index c363d1c4c..8776f9752 100755 --- a/core/lib/Thelia/Core/Security/Role/Role.php +++ b/core/lib/Thelia/Core/Security/Role/Role.php @@ -38,4 +38,8 @@ class Role implements RoleInterface { return $this->role; } + + public function __toString() { + return $this->role; + } } diff --git a/core/lib/Thelia/Core/Template/BaseParam/Secure.php b/core/lib/Thelia/Core/Template/BaseParam/Secure.php index 43713b150..ecc36299e 100755 --- a/core/lib/Thelia/Core/Template/BaseParam/Secure.php +++ b/core/lib/Thelia/Core/Template/BaseParam/Secure.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index 59747eec1..80e0a85f6 100755 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php b/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php index a2695ce6b..0f9972e97 100755 --- a/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php +++ b/core/lib/Thelia/Core/Template/Element/Exception/ElementNotFoundException.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php b/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php index 5a4983aa2..b77f76a09 100755 --- a/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php +++ b/core/lib/Thelia/Core/Template/Element/Exception/InvalidElementException.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Element/LoopResult.php b/core/lib/Thelia/Core/Template/Element/LoopResult.php index f01c74210..c3a97983f 100755 --- a/core/lib/Thelia/Core/Template/Element/LoopResult.php +++ b/core/lib/Thelia/Core/Template/Element/LoopResult.php @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Element/LoopResultRow.php b/core/lib/Thelia/Core/Template/Element/LoopResultRow.php index 3ac05fe5c..24fa67c7e 100755 --- a/core/lib/Thelia/Core/Template/Element/LoopResultRow.php +++ b/core/lib/Thelia/Core/Template/Element/LoopResultRow.php @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php b/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php index 87b41ebc5..37856c620 100755 --- a/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php +++ b/core/lib/Thelia/Core/Template/Exception/ResourceNotFoundException.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\Template\Exception; diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php index 5b8b99f03..265fdbdf2 100755 --- a/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/Argument.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop\Argument; diff --git a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php index b4b680e08..e4fca8549 100755 --- a/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php +++ b/core/lib/Thelia/Core/Template/Loop/Argument/ArgumentCollection.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\Template\Loop\Argument; diff --git a/core/lib/Thelia/Core/Template/Loop/Category.php b/core/lib/Thelia/Core/Template/Loop/Category.php index 96809f5dc..4c915ae1f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Category.php +++ b/core/lib/Thelia/Core/Template/Loop/Category.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 001c5c750..c90111c8f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/Template/ParserInterface.php b/core/lib/Thelia/Core/Template/ParserInterface.php index 08308659c..bbf926812 100755 --- a/core/lib/Thelia/Core/Template/ParserInterface.php +++ b/core/lib/Thelia/Core/Template/ParserInterface.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Core\Template; diff --git a/core/lib/Thelia/Core/Thelia.php b/core/lib/Thelia/Core/Thelia.php index b023a4eab..526024707 100755 --- a/core/lib/Thelia/Core/Thelia.php +++ b/core/lib/Thelia/Core/Thelia.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Core/TheliaContainerBuilder.php b/core/lib/Thelia/Core/TheliaContainerBuilder.php index fb765ebb2..a97019b60 100755 --- a/core/lib/Thelia/Core/TheliaContainerBuilder.php +++ b/core/lib/Thelia/Core/TheliaContainerBuilder.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Exception/MemberAccessException.php b/core/lib/Thelia/Exception/MemberAccessException.php index 9ceea565e..e1f65e590 100755 --- a/core/lib/Thelia/Exception/MemberAccessException.php +++ b/core/lib/Thelia/Exception/MemberAccessException.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Exception; diff --git a/core/lib/Thelia/Form/AdminLogin.php b/core/lib/Thelia/Form/AdminLogin.php index b67e788fc..6a96d4c78 100755 --- a/core/lib/Thelia/Form/AdminLogin.php +++ b/core/lib/Thelia/Form/AdminLogin.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ diff --git a/core/lib/Thelia/Form/CustomerCreation.php b/core/lib/Thelia/Form/CustomerCreation.php index 9f675e74e..df2fb1c2c 100755 --- a/core/lib/Thelia/Form/CustomerCreation.php +++ b/core/lib/Thelia/Form/CustomerCreation.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ diff --git a/core/lib/Thelia/Form/CustomerLogin.php b/core/lib/Thelia/Form/CustomerLogin.php index e1096f9b4..64937cbf6 100644 --- a/core/lib/Thelia/Form/CustomerLogin.php +++ b/core/lib/Thelia/Form/CustomerLogin.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -27,16 +27,17 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\Choice; +use Symfony\Component\Validator\Constraints\Email; class CustomerLogin extends BaseForm { protected function buildForm() { $this->formBuilder - ->add("username", "text", array( + ->add("email", "text", array( "constraints" => array( new NotBlank(), - new Length(array("min" => 3)) + new Email() ) )) ->add("password", "password", array( @@ -45,7 +46,8 @@ class CustomerLogin extends BaseForm { ) )) ->add("remember_me", "checkbox") - ; + ->add("success_url", "text") + ; } public function getName() diff --git a/core/lib/Thelia/Log/AbstractTlogDestination.php b/core/lib/Thelia/Log/AbstractTlogDestination.php index 4b859df20..5241bcdd8 100755 --- a/core/lib/Thelia/Log/AbstractTlogDestination.php +++ b/core/lib/Thelia/Log/AbstractTlogDestination.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php index d7fa4f5c2..2f9a0e5bc 100755 --- a/core/lib/Thelia/Log/Destination/TlogDestinationFile.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationFile.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php b/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php index d0896cd26..a510e18ef 100755 --- a/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationHtml.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationNull.php b/core/lib/Thelia/Log/Destination/TlogDestinationNull.php index b5bd3dcbb..1fa8eaf3a 100755 --- a/core/lib/Thelia/Log/Destination/TlogDestinationNull.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationNull.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Log/Destination/TlogDestinationText.php b/core/lib/Thelia/Log/Destination/TlogDestinationText.php index 379794ce4..b03f03f65 100755 --- a/core/lib/Thelia/Log/Destination/TlogDestinationText.php +++ b/core/lib/Thelia/Log/Destination/TlogDestinationText.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Log/Tlog.php b/core/lib/Thelia/Log/Tlog.php index 76b813944..907c0d8e7 100755 --- a/core/lib/Thelia/Log/Tlog.php +++ b/core/lib/Thelia/Log/Tlog.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Log; diff --git a/core/lib/Thelia/Log/TlogDestinationConfig.php b/core/lib/Thelia/Log/TlogDestinationConfig.php index b945b9dfd..1f60ba08e 100755 --- a/core/lib/Thelia/Log/TlogDestinationConfig.php +++ b/core/lib/Thelia/Log/TlogDestinationConfig.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Routing/Matcher/DefaultMatcher.php b/core/lib/Thelia/Routing/Matcher/DefaultMatcher.php index b0ce6b841..6042a7cad 100755 --- a/core/lib/Thelia/Routing/Matcher/DefaultMatcher.php +++ b/core/lib/Thelia/Routing/Matcher/DefaultMatcher.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Routing\Matcher; diff --git a/core/lib/Thelia/Routing/NullUrlGenerator.php b/core/lib/Thelia/Routing/NullUrlGenerator.php index 0206a7f2e..f43f4ee5a 100755 --- a/core/lib/Thelia/Routing/NullUrlGenerator.php +++ b/core/lib/Thelia/Routing/NullUrlGenerator.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Routing/TheliaMatcherCollection.php b/core/lib/Thelia/Routing/TheliaMatcherCollection.php index bf1c8e2f2..b6769c148 100755 --- a/core/lib/Thelia/Routing/TheliaMatcherCollection.php +++ b/core/lib/Thelia/Routing/TheliaMatcherCollection.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Routing; diff --git a/core/lib/Thelia/Tests/Command/CacheClearTest.php b/core/lib/Thelia/Tests/Command/CacheClearTest.php index 019414b02..f29d600ed 100755 --- a/core/lib/Thelia/Tests/Command/CacheClearTest.php +++ b/core/lib/Thelia/Tests/Command/CacheClearTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Tests\Command; diff --git a/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php b/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php index 84bc6c1a7..27255c089 100755 --- a/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php +++ b/core/lib/Thelia/Tests/Controller/DefaultControllerTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php b/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php index 21d1f132b..e8dc69d99 100755 --- a/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Loop/Argument/ArgumentCollectionTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Log/TlogTest.php b/core/lib/Thelia/Tests/Log/TlogTest.php index eabc18338..f94b759be 100755 --- a/core/lib/Thelia/Tests/Log/TlogTest.php +++ b/core/lib/Thelia/Tests/Log/TlogTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php b/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php index 2a8ba5fa0..2a4409860 100755 --- a/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AlphaNumStringListTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php b/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php index 46526715b..ae07cce6b 100755 --- a/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AlphaNumStringTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/AnyTypeTest.php b/core/lib/Thelia/Tests/Type/AnyTypeTest.php index 8e959d154..e4750000e 100755 --- a/core/lib/Thelia/Tests/Type/AnyTypeTest.php +++ b/core/lib/Thelia/Tests/Type/AnyTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/BooleanTypeTest.php b/core/lib/Thelia/Tests/Type/BooleanTypeTest.php index d91cc6bc9..03765d541 100755 --- a/core/lib/Thelia/Tests/Type/BooleanTypeTest.php +++ b/core/lib/Thelia/Tests/Type/BooleanTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/EnumListTypeTest.php b/core/lib/Thelia/Tests/Type/EnumListTypeTest.php index a992fb0bd..a225464c1 100755 --- a/core/lib/Thelia/Tests/Type/EnumListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/EnumListTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/EnumTypeTest.php b/core/lib/Thelia/Tests/Type/EnumTypeTest.php index 5ed4637e9..10660ee38 100755 --- a/core/lib/Thelia/Tests/Type/EnumTypeTest.php +++ b/core/lib/Thelia/Tests/Type/EnumTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/FloatTypeTest.php b/core/lib/Thelia/Tests/Type/FloatTypeTest.php index 82bf9bfe2..600c696f8 100755 --- a/core/lib/Thelia/Tests/Type/FloatTypeTest.php +++ b/core/lib/Thelia/Tests/Type/FloatTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/IntListTypeTest.php b/core/lib/Thelia/Tests/Type/IntListTypeTest.php index 80ffa3e2e..a10d124e4 100755 --- a/core/lib/Thelia/Tests/Type/IntListTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntListTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/IntTypeTest.php b/core/lib/Thelia/Tests/Type/IntTypeTest.php index 2f9ce8a40..7d39093dc 100755 --- a/core/lib/Thelia/Tests/Type/IntTypeTest.php +++ b/core/lib/Thelia/Tests/Type/IntTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/JsonTypeTest.php b/core/lib/Thelia/Tests/Type/JsonTypeTest.php index 79b2c59b8..1f4b0162b 100755 --- a/core/lib/Thelia/Tests/Type/JsonTypeTest.php +++ b/core/lib/Thelia/Tests/Type/JsonTypeTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tests/Type/TypeCollectionTest.php b/core/lib/Thelia/Tests/Type/TypeCollectionTest.php index 5cef59215..0aaec01df 100755 --- a/core/lib/Thelia/Tests/Type/TypeCollectionTest.php +++ b/core/lib/Thelia/Tests/Type/TypeCollectionTest.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ diff --git a/core/lib/Thelia/Tools/DIGenerator.php b/core/lib/Thelia/Tools/DIGenerator.php index a17586a55..f18338d5b 100755 --- a/core/lib/Thelia/Tools/DIGenerator.php +++ b/core/lib/Thelia/Tools/DIGenerator.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Tools; diff --git a/core/lib/Thelia/Tools/Redirect.php b/core/lib/Thelia/Tools/Redirect.php index b4c89fcce..92ae28fa9 100755 --- a/core/lib/Thelia/Tools/Redirect.php +++ b/core/lib/Thelia/Tools/Redirect.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,28 +17,26 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Tools; -use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpFoundation\RedirectResponse; class Redirect { - + public static function unauthorize($url) { self::exec($url, 401); } - + public static function exec($url, $status = 302) { - $response = new Response('', $status, array( - "location" => $url - )); - + $response = new RedirectResponse($url, $status); + $response->send(); exit; } diff --git a/core/lib/Thelia/Type/AlphaNumStringListType.php b/core/lib/Thelia/Type/AlphaNumStringListType.php index 41af21e07..4f24eb274 100755 --- a/core/lib/Thelia/Type/AlphaNumStringListType.php +++ b/core/lib/Thelia/Type/AlphaNumStringListType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/AlphaNumStringType.php b/core/lib/Thelia/Type/AlphaNumStringType.php index 963237cb0..726e6eb67 100755 --- a/core/lib/Thelia/Type/AlphaNumStringType.php +++ b/core/lib/Thelia/Type/AlphaNumStringType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/AnyType.php b/core/lib/Thelia/Type/AnyType.php index ca0a14616..5cdbb1272 100755 --- a/core/lib/Thelia/Type/AnyType.php +++ b/core/lib/Thelia/Type/AnyType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/BooleanType.php b/core/lib/Thelia/Type/BooleanType.php index 0c85d3ba8..ecbf6cfe3 100755 --- a/core/lib/Thelia/Type/BooleanType.php +++ b/core/lib/Thelia/Type/BooleanType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/EnumListType.php b/core/lib/Thelia/Type/EnumListType.php index 1603dc89f..55b78fe5c 100755 --- a/core/lib/Thelia/Type/EnumListType.php +++ b/core/lib/Thelia/Type/EnumListType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/EnumType.php b/core/lib/Thelia/Type/EnumType.php index 0221f8b8e..416f9714a 100755 --- a/core/lib/Thelia/Type/EnumType.php +++ b/core/lib/Thelia/Type/EnumType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/FloatType.php b/core/lib/Thelia/Type/FloatType.php index 3c10df86c..f82f34b58 100755 --- a/core/lib/Thelia/Type/FloatType.php +++ b/core/lib/Thelia/Type/FloatType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/IntListType.php b/core/lib/Thelia/Type/IntListType.php index cd4eadf22..d07e5e18f 100755 --- a/core/lib/Thelia/Type/IntListType.php +++ b/core/lib/Thelia/Type/IntListType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/IntType.php b/core/lib/Thelia/Type/IntType.php index c2d6dcfa8..8e2ec4fd8 100755 --- a/core/lib/Thelia/Type/IntType.php +++ b/core/lib/Thelia/Type/IntType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/JsonType.php b/core/lib/Thelia/Type/JsonType.php index 39ee57d53..5a195b291 100755 --- a/core/lib/Thelia/Type/JsonType.php +++ b/core/lib/Thelia/Type/JsonType.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/TypeCollection.php b/core/lib/Thelia/Type/TypeCollection.php index 460d9b96e..64e6c8c28 100755 --- a/core/lib/Thelia/Type/TypeCollection.php +++ b/core/lib/Thelia/Type/TypeCollection.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/core/lib/Thelia/Type/TypeInterface.php b/core/lib/Thelia/Type/TypeInterface.php index b2ba11a4b..b293b1783 100755 --- a/core/lib/Thelia/Type/TypeInterface.php +++ b/core/lib/Thelia/Type/TypeInterface.php @@ -4,7 +4,7 @@ /* Thelia */ /* */ /* Copyright (c) OpenStudio */ -/* email : info@thelia.net */ +/* email : info@thelia.net */ /* web : http://www.thelia.net */ /* */ /* This program is free software; you can redistribute it and/or modify */ @@ -17,7 +17,7 @@ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ -/* along with this program. If not, see . */ +/* along with this program. If not, see . */ /* */ /*************************************************************************************/ namespace Thelia\Type; diff --git a/templates/admin/default/home.html b/templates/admin/default/home.html index f49172464..79266eadb 100755 --- a/templates/admin/default/home.html +++ b/templates/admin/default/home.html @@ -1,4 +1,4 @@ -{check_auth context="admin" roles="ADMIN" login_url="login"} +{check_auth context="admin" roles="ROLE_ADMIN" login_url="login"} {$page_title={intl l='Home'}} {include file='includes/header.inc.html'} diff --git a/templates/admin/default/login.html b/templates/admin/default/login.html index b674a1dc5..1f8146993 100755 --- a/templates/admin/default/login.html +++ b/templates/admin/default/login.html @@ -21,7 +21,7 @@ {form_hidden_fields form=$form} {form_field form=$form field='success_url'} - {* redirect to /admin *} + {* on success, redirect to /admin *} {/form_field} {form_field form=$form field='username'} diff --git a/templates/smarty-sample/includes/header.html b/templates/smarty-sample/includes/header.html index 7dbd94ecc..b48cbc770 100755 --- a/templates/smarty-sample/includes/header.html +++ b/templates/smarty-sample/includes/header.html @@ -1,7 +1,7 @@ - {intl l="Hi, I'm a Thelia TPex template"} + {$page_title|default:{intl l="Thelia II"}} {stylesheets file='../assets/css/*' filters='less,cssembed'} diff --git a/templates/smarty-sample/index.html b/templates/smarty-sample/index.html index 53834febf..6ee109b9e 100755 --- a/templates/smarty-sample/index.html +++ b/templates/smarty-sample/index.html @@ -1,7 +1,7 @@ {include file="includes/header.html"}
-{loop type="auth" name="auth_test" context="front" roles="CUSTOMER"} +{loop type="auth" name="auth_test" context="front" roles="ROLE_CUSTOMER"}

Customer is authentified :-)

{/loop} diff --git a/web/index_dev.php b/web/index_dev.php index 5e5bc0e96..1251c012f 100755 --- a/web/index_dev.php +++ b/web/index_dev.php @@ -24,4 +24,4 @@ $response = $thelia->handle($request)->prepare($request)->send(); $thelia->terminate($request, $response); -echo ""; \ No newline at end of file +echo "\n"; \ No newline at end of file