Merge frontend
This commit is contained in:
@@ -4,11 +4,6 @@
|
|||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
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">
|
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||||
|
|
||||||
<route id="home" path="/">
|
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">index</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="ajax.mini-cart" path="/ajax/mini-cart">
|
<route id="ajax.mini-cart" path="/ajax/mini-cart">
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
||||||
<default key="_view">includes/mini-cart</default>
|
<default key="_view">includes/mini-cart</default>
|
||||||
@@ -18,60 +13,31 @@
|
|||||||
<default key="_view">includes/addedToCart</default>
|
<default key="_view">includes/addedToCart</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- Search routes -->
|
|
||||||
<route id="search" path="/search">
|
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">search</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="view_all" path="/view_all" methods="get">
|
<!-- Register -->
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">view_all</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<!-- Customer routes : Register -->
|
|
||||||
<route id="customer.create.process" path="/register" methods="post">
|
<route id="customer.create.process" path="/register" methods="post">
|
||||||
<default key="_controller">Thelia\Controller\Front\CustomerController::createAction</default>
|
<default key="_controller">Thelia\Controller\Front\CustomerController::createAction</default>
|
||||||
<default key="_view">register</default>
|
<default key="_view">register</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="customer.create.view" path="/register">
|
<!-- Login -->
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">register</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<!-- Customer routes : Login -->
|
|
||||||
<route id="customer.login.process" path="/login" methods="post">
|
<route id="customer.login.process" path="/login" methods="post">
|
||||||
<default key="_controller">Thelia\Controller\Front\CustomerController::loginAction</default>
|
<default key="_controller">Thelia\Controller\Front\CustomerController::loginAction</default>
|
||||||
<default key="_view">login</default>
|
<default key="_view">login</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="customer.login.view" path="/login">
|
<!-- Forgot Password -->
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">login</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="customer.password.retrieve.process" path="/password" methods="post">
|
<route id="customer.password.retrieve.process" path="/password" methods="post">
|
||||||
<default key="_controller">Thelia\Controller\Front\CustomerController::newPasswordAction</default>
|
<default key="_controller">Thelia\Controller\Front\CustomerController::newPasswordAction</default>
|
||||||
<default key="_view">password</default>
|
<default key="_view">password</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<route id="customer.password.retrieve.view" path="/password" methods="get">
|
<!-- Logout -->
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">password</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<!-- Customer routes : Logout -->
|
|
||||||
<route id="customer.logout.process" path="/logout">
|
<route id="customer.logout.process" path="/logout">
|
||||||
<default key="_controller">Thelia\Controller\Front\CustomerController::logoutAction</default>
|
<default key="_controller">Thelia\Controller\Front\CustomerController::logoutAction</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- Customer routes : Account -->
|
<!-- Account -->
|
||||||
<route id="customer.account.view" path="/account">
|
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">account</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="customer.update.view" path="/account/update" methods="get">
|
<route id="customer.update.view" path="/account/update" methods="get">
|
||||||
<default key="_controller">Thelia\Controller\Front\CustomerController::viewAction</default>
|
<default key="_controller">Thelia\Controller\Front\CustomerController::viewAction</default>
|
||||||
<default key="_view">account-update</default>
|
<default key="_view">account-update</default>
|
||||||
@@ -84,7 +50,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<route id="customer.password.change.process" path="/account/password" methods="post">
|
<route id="customer.password.change.process" path="/account/password" methods="post">
|
||||||
<default key="_controller">Thelia\Controller\Front\CustomerController::newPasswordAction</default>
|
<default key="_controller">Thelia\Controller\Front\CustomerController::updatePasswordAction</default>
|
||||||
<default key="_view">account-password</default>
|
<default key="_view">account-password</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
@@ -92,7 +58,6 @@
|
|||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
||||||
<default key="_view">account-password</default>
|
<default key="_view">account-password</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- end customer routes -->
|
<!-- end customer routes -->
|
||||||
|
|
||||||
<!-- customer address routes -->
|
<!-- customer address routes -->
|
||||||
@@ -130,11 +95,6 @@
|
|||||||
<!-- end customer address routes -->
|
<!-- end customer address routes -->
|
||||||
|
|
||||||
<!-- cart routes -->
|
<!-- cart routes -->
|
||||||
<route id="cart.view" path="/cart">
|
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">cart</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="cart.add.process" path="/cart/add">
|
<route id="cart.add.process" path="/cart/add">
|
||||||
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
|
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
|
||||||
</route>
|
</route>
|
||||||
@@ -148,7 +108,6 @@
|
|||||||
<default key="_controller">Thelia\Controller\Front\CartController::changeItem</default>
|
<default key="_controller">Thelia\Controller\Front\CartController::changeItem</default>
|
||||||
<default key="_view">cart</default>
|
<default key="_view">cart</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- end cart routes -->
|
<!-- end cart routes -->
|
||||||
|
|
||||||
<!-- order management process -->
|
<!-- order management process -->
|
||||||
@@ -187,11 +146,6 @@
|
|||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- contact management -->
|
<!-- contact management -->
|
||||||
<route id="contact.display" path="/contact" methods="get">
|
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">contact</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="contact.send" path="/contact" methods="post">
|
<route id="contact.send" path="/contact" methods="post">
|
||||||
<default key="_controller">Thelia\Controller\Front\ContactController::sendAction</default>
|
<default key="_controller">Thelia\Controller\Front\ContactController::sendAction</default>
|
||||||
<default key="_view">contact</default>
|
<default key="_view">contact</default>
|
||||||
@@ -204,16 +158,17 @@
|
|||||||
<!-- end contact management -->
|
<!-- end contact management -->
|
||||||
|
|
||||||
<!-- newsletter management -->
|
<!-- newsletter management -->
|
||||||
|
|
||||||
<route id="newsletter.display" path="/newsletter" methods="get">
|
|
||||||
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
|
||||||
<default key="_view">newsletter</default>
|
|
||||||
</route>
|
|
||||||
|
|
||||||
<route id="newsletter.process" path="/newsletter" methods="post">
|
<route id="newsletter.process" path="/newsletter" methods="post">
|
||||||
<default key="_controller">Thelia\Controller\Front\NewsletterController::subscribeAction</default>
|
<default key="_controller">Thelia\Controller\Front\NewsletterController::subscribeAction</default>
|
||||||
<default key="_view">newsletter</default>
|
<default key="_view">newsletter</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
<!-- end newsletter management -->
|
<!-- end newsletter management -->
|
||||||
|
|
||||||
|
<!-- Default Route -->
|
||||||
|
<route id="default" path="/{_view}">
|
||||||
|
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
|
||||||
|
<default key="_view">index</default>
|
||||||
|
<requirement key="_view">^(?!admin)[^/]+</requirement>
|
||||||
|
</route>
|
||||||
|
|
||||||
</routes>
|
</routes>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ use Thelia\Core\Security\Exception\UsernameNotFoundException;
|
|||||||
use Thelia\Form\CustomerCreateForm;
|
use Thelia\Form\CustomerCreateForm;
|
||||||
use Thelia\Form\CustomerLogin;
|
use Thelia\Form\CustomerLogin;
|
||||||
use Thelia\Form\CustomerLostPasswordForm;
|
use Thelia\Form\CustomerLostPasswordForm;
|
||||||
|
use Thelia\Form\CustomerPasswordUpdateForm;
|
||||||
use Thelia\Form\CustomerUpdateForm;
|
use Thelia\Form\CustomerUpdateForm;
|
||||||
use Thelia\Form\Exception\FormValidationException;
|
use Thelia\Form\Exception\FormValidationException;
|
||||||
use Thelia\Model\Customer;
|
use Thelia\Model\Customer;
|
||||||
@@ -49,6 +50,7 @@ class CustomerController extends BaseFrontController
|
|||||||
{
|
{
|
||||||
use \Thelia\Cart\CartTrait;
|
use \Thelia\Cart\CartTrait;
|
||||||
|
|
||||||
|
|
||||||
public function newPasswordAction()
|
public function newPasswordAction()
|
||||||
{
|
{
|
||||||
if (! $this->getSecurityContext()->hasCustomerUser()) {
|
if (! $this->getSecurityContext()->hasCustomerUser()) {
|
||||||
@@ -158,6 +160,44 @@ class CustomerController extends BaseFrontController
|
|||||||
$this->getParserContext()->addForm($customerUpdateForm);
|
$this->getParserContext()->addForm($customerUpdateForm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function updatePasswordAction()
|
||||||
|
{
|
||||||
|
if ($this->getSecurityContext()->hasCustomerUser()) {
|
||||||
|
$message = false;
|
||||||
|
|
||||||
|
$customerPasswordUpdateForm = new CustomerPasswordUpdateForm($this->getRequest());
|
||||||
|
|
||||||
|
try {
|
||||||
|
$customer = $this->getSecurityContext()->getCustomerUser();
|
||||||
|
|
||||||
|
$form = $this->validateForm($customerPasswordUpdateForm, "post");
|
||||||
|
|
||||||
|
$customerChangeEvent = $this->createEventInstance($form->getData());
|
||||||
|
$customerChangeEvent->setCustomer($customer);
|
||||||
|
//$this->dispatch(TheliaEvents::CUSTOMER_UPDATEACCOUNT, $customerChangeEvent);
|
||||||
|
|
||||||
|
$this->redirectSuccess($customerPasswordUpdateForm);
|
||||||
|
|
||||||
|
} catch (FormValidationException $e) {
|
||||||
|
$message = sprintf("Please check your input: %s", $e->getMessage());
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$message = sprintf("Sorry, an error occured: %s", $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($message !== false) {
|
||||||
|
Tlog::getInstance()->error(sprintf("Error during customer password modification process : %s.", $message));
|
||||||
|
|
||||||
|
$customerPasswordUpdateForm->setErrorMessage($message);
|
||||||
|
|
||||||
|
$this->getParserContext()
|
||||||
|
->addForm($customerPasswordUpdateForm)
|
||||||
|
->setGeneralError($message)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function updateAction()
|
public function updateAction()
|
||||||
{
|
{
|
||||||
if ($this->getSecurityContext()->hasCustomerUser()) {
|
if ($this->getSecurityContext()->hasCustomerUser()) {
|
||||||
|
|||||||
@@ -22,8 +22,6 @@
|
|||||||
/*************************************************************************************/
|
/*************************************************************************************/
|
||||||
namespace Thelia\Form;
|
namespace Thelia\Form;
|
||||||
|
|
||||||
use Symfony\Component\Form\FormInterface;
|
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
|
|
||||||
use Symfony\Component\Validator\Constraints;
|
use Symfony\Component\Validator\Constraints;
|
||||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||||
use Symfony\Component\Validator\Constraints\Email;
|
use Symfony\Component\Validator\Constraints\Email;
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ namespace Thelia\Form;
|
|||||||
use Symfony\Component\Validator\Constraints;
|
use Symfony\Component\Validator\Constraints;
|
||||||
use Symfony\Component\Validator\ExecutionContextInterface;
|
use Symfony\Component\Validator\ExecutionContextInterface;
|
||||||
use Thelia\Model\ConfigQuery;
|
use Thelia\Model\ConfigQuery;
|
||||||
use Thelia\Model\CustomerQuery;
|
|
||||||
use Thelia\Core\Translation\Translator;
|
use Thelia\Core\Translation\Translator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -80,7 +79,7 @@ class CustomerPasswordUpdateForm extends BaseForm
|
|||||||
|
|
||||||
public function verifyCurrentPasswordField($value, ExecutionContextInterface $context)
|
public function verifyCurrentPasswordField($value, ExecutionContextInterface $context)
|
||||||
{
|
{
|
||||||
|
// Check current password
|
||||||
}
|
}
|
||||||
|
|
||||||
public function verifyPasswordField($value, ExecutionContextInterface $context)
|
public function verifyPasswordField($value, ExecutionContextInterface $context)
|
||||||
@@ -88,7 +87,7 @@ class CustomerPasswordUpdateForm extends BaseForm
|
|||||||
$data = $context->getRoot()->getData();
|
$data = $context->getRoot()->getData();
|
||||||
|
|
||||||
if ($data["password"] != $data["password_confirm"]) {
|
if ($data["password"] != $data["password_confirm"]) {
|
||||||
$context->addViolation("password confirmation is not the same as password field.");
|
$context->addViolation("Password confirmation is not the same as password field.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||||
|
|
||||||
<fieldset id="register-info" class="panel panel">
|
<fieldset id="register-info" class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{intl l="Login Information"}
|
{intl l="Login Information"}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||||
|
|
||||||
<fieldset id="register-info" class="panel panel">
|
<fieldset id="register-info" class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{intl l="Personal Informations"}
|
{intl l="Personal Informations"}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
{form name="thelia.front.contact"}
|
{form name="thelia.front.contact"}
|
||||||
<form id="form-contact" action="{url path="/contact"}" method="post" role="form">
|
<form id="form-contact" action="{url path="/contact"}" method="post" role="form">
|
||||||
{form_hidden_fields form=$form}
|
{form_hidden_fields form=$form}
|
||||||
<fieldset id="contact-info" class="panel panel">
|
<fieldset id="contact-info" class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{intl l="Send us a message"}
|
{intl l="Send us a message"}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
{/form_field}
|
{/form_field}
|
||||||
{form_hidden_fields form=$form}
|
{form_hidden_fields form=$form}
|
||||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||||
<fieldset id="register-info" class="panel panel">
|
<fieldset id="register-info" class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
1. {intl l="Personal Informations"}
|
1. {intl l="Personal Informations"}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user