Merge branch 'master' of https://github.com/thelia/thelia into coupon
# By franck (6) and others # Via franck (3) and others * 'master' of https://github.com/thelia/thelia: Implemented "Remember Me" feature on admin. Started template management Added Templates events First version of installation wizard tax engine retriever allow address removal from front Insert pagination inside tfoot allow update customer address in front tempalte allow to create a new address allow to make an address as default on update action Finished attributes management Fixed action column alignment Fixed duplication parameter check regexp absoluteUrl prevetn duplicate parameters in generated URL
This commit is contained in:
@@ -38,6 +38,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
|
||||
// List ordering
|
||||
protected $defaultListOrder;
|
||||
protected $orderRequestParameterName;
|
||||
|
||||
// Permissions
|
||||
protected $viewPermissionIdentifier;
|
||||
@@ -74,6 +75,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
$objectName,
|
||||
|
||||
$defaultListOrder = null,
|
||||
$orderRequestParameterName = null,
|
||||
|
||||
$viewPermissionIdentifier,
|
||||
$createPermissionIdentifier,
|
||||
@@ -89,8 +91,9 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
$this->objectName = $objectName;
|
||||
|
||||
$this->defaultListOrder = $defaultListOrder;
|
||||
$this->orderRequestParameterName = $orderRequestParameterName;
|
||||
|
||||
$this->viewPermissionIdentifier = $viewPermissionIdentifier;
|
||||
$this->viewPermissionIdentifier = $viewPermissionIdentifier;
|
||||
$this->createPermissionIdentifier = $createPermissionIdentifier;
|
||||
$this->updatePermissionIdentifier = $updatePermissionIdentifier;
|
||||
$this->deletePermissionIdentifier = $deletePermissionIdentifier;
|
||||
@@ -194,36 +197,59 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
protected abstract function redirectToListTemplate();
|
||||
|
||||
|
||||
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
|
||||
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
|
||||
{
|
||||
throw new \LogicException ("Position Update is not supported for this object");
|
||||
}
|
||||
|
||||
protected function createToggleVisibilityEvent() {
|
||||
|
||||
protected function createToggleVisibilityEvent()
|
||||
{
|
||||
throw new \LogicException ("Toggle Visibility is not supported for this object");
|
||||
}
|
||||
|
||||
/**
|
||||
* Put in this method post object creation processing if required.
|
||||
*
|
||||
* @param unknown $createEvent the create event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
*/
|
||||
protected function performAdditionalCreateAction($createEvent)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put in this method post object update processing if required.
|
||||
*
|
||||
* @param unknown $updateEvent the update event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
*/
|
||||
protected function performAdditionalUpdateAction($updateeEvent)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Put in this method post object delete processing if required.
|
||||
*
|
||||
* @param unknown $deleteEvent the delete event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
*/
|
||||
protected function performAdditionalDeleteAction($deleteEvent)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current list order identifier, updating it in the same time.
|
||||
*/
|
||||
protected function getCurrentListOrder($update_session = true) {
|
||||
|
||||
$order = null;
|
||||
|
||||
if ($this->defaultListOrder) {
|
||||
|
||||
$orderSessionIdentifier = sprintf("admin.%s.currentListOrder", $this->objectName);
|
||||
|
||||
// Find the current order
|
||||
$order = $this->getRequest()->get(
|
||||
'order',
|
||||
$this->getSession()->get($orderSessionIdentifier, $this->defaultListOrder)
|
||||
);
|
||||
|
||||
if ($update_session) $this->getSession()->set($orderSessionIdentifier, $order);
|
||||
}
|
||||
|
||||
return $order;
|
||||
protected function getCurrentListOrder($update_session = true)
|
||||
{
|
||||
return $this->getListOrderFromSession(
|
||||
$this->objectName,
|
||||
$this->orderRequestParameterName,
|
||||
$this->defaultListOrder
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -283,6 +309,8 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) created", ucfirst($this->objectName), $this->getObjectLabel($createdObject), $this->getObjectId($createdObject)));
|
||||
}
|
||||
|
||||
$this->performAdditionalCreateAction($createEvent);
|
||||
|
||||
// Substitute _ID_ in the URL with the ID of the created object
|
||||
$successUrl = str_replace('_ID_', $this->getObjectId($createdObject), $creationForm->getSuccessUrl());
|
||||
|
||||
@@ -317,7 +345,7 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
if (null !== $response = $this->checkAuth($this->updatePermissionIdentifier)) return $response;
|
||||
|
||||
// Load the object
|
||||
$object = $this->getExistingObject($this->getRequest());
|
||||
$object = $this->getExistingObject();
|
||||
|
||||
if ($object != null) {
|
||||
|
||||
@@ -368,6 +396,8 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
$this->adminLogAppend(sprintf("%s %s (ID %s) modified", ucfirst($this->objectName), $this->getObjectLabel($changedObject), $this->getObjectId($changedObject)));
|
||||
}
|
||||
|
||||
$this->performAdditionalUpdateAction($changeEvent);
|
||||
|
||||
// If we have to stay on the same page, do not redirect to the succesUrl,
|
||||
// just redirect to the edit page again.
|
||||
if ($this->getRequest()->get('save_mode') == 'stay') {
|
||||
@@ -468,6 +498,11 @@ abstract class AbstractCrudController extends BaseAdminController
|
||||
sprintf("%s %s (ID %s) deleted", ucfirst($this->objectName), $this->getObjectLabel($deletedObject), $this->getObjectId($deletedObject)));
|
||||
}
|
||||
|
||||
$this->redirectToListTemplate();
|
||||
$response = $this->performAdditionalDeleteAction($deleteEvent);
|
||||
|
||||
if ($response == null)
|
||||
$this->redirectToListTemplate();
|
||||
else
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
namespace Thelia\Controller\Admin;
|
||||
|
||||
use Thelia\Core\Security\Authentication\AdminTokenAuthenticator;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Core\Security\Exception\TokenAuthenticationException;
|
||||
|
||||
class AdminController extends BaseAdminController
|
||||
{
|
||||
public function indexAction()
|
||||
|
||||
@@ -39,10 +39,12 @@ use Thelia\Core\Event\UpdatePositionEvent;
|
||||
*/
|
||||
class AttributeAvController extends AbstractCrudController
|
||||
{
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
'attribute',
|
||||
'attributeav',
|
||||
'manual',
|
||||
'order',
|
||||
|
||||
'admin.configuration.attributes-av.view',
|
||||
'admin.configuration.attributes-av.create',
|
||||
@@ -57,15 +59,18 @@ class AttributeAvController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function getCreationForm() {
|
||||
protected function getCreationForm()
|
||||
{
|
||||
return new AttributeAvCreationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getUpdateForm() {
|
||||
protected function getUpdateForm()
|
||||
{
|
||||
return new AttributeAvModificationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getCreationEvent($formData) {
|
||||
protected function getCreationEvent($formData)
|
||||
{
|
||||
$createEvent = new AttributeAvCreateEvent();
|
||||
|
||||
$createEvent
|
||||
@@ -77,8 +82,8 @@ class AttributeAvController extends AbstractCrudController
|
||||
return $createEvent;
|
||||
}
|
||||
|
||||
protected function getUpdateEvent($formData) {
|
||||
|
||||
protected function getUpdateEvent($formData)
|
||||
{
|
||||
$changeEvent = new AttributeAvUpdateEvent($formData['id']);
|
||||
|
||||
// Create and dispatch the change event
|
||||
@@ -93,8 +98,8 @@ class AttributeAvController extends AbstractCrudController
|
||||
return $changeEvent;
|
||||
}
|
||||
|
||||
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
|
||||
|
||||
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
|
||||
{
|
||||
return new UpdatePositionEvent(
|
||||
$this->getRequest()->get('attributeav_id', null),
|
||||
$positionChangeMode,
|
||||
@@ -102,16 +107,18 @@ class AttributeAvController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function getDeleteEvent() {
|
||||
protected function getDeleteEvent()
|
||||
{
|
||||
return new AttributeAvDeleteEvent($this->getRequest()->get('attributeav_id'));
|
||||
}
|
||||
|
||||
protected function eventContainsObject($event) {
|
||||
protected function eventContainsObject($event)
|
||||
{
|
||||
return $event->hasAttributeAv();
|
||||
}
|
||||
|
||||
protected function hydrateObjectForm($object) {
|
||||
|
||||
protected function hydrateObjectForm($object)
|
||||
{
|
||||
$data = array(
|
||||
'id' => $object->getId(),
|
||||
'locale' => $object->getLocale(),
|
||||
@@ -125,32 +132,38 @@ class AttributeAvController extends AbstractCrudController
|
||||
return new AttributeAvModificationForm($this->getRequest(), "form", $data);
|
||||
}
|
||||
|
||||
protected function getObjectFromEvent($event) {
|
||||
protected function getObjectFromEvent($event)
|
||||
{
|
||||
return $event->hasAttributeAv() ? $event->getAttributeAv() : null;
|
||||
}
|
||||
|
||||
protected function getExistingObject() {
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return AttributeAvQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('attributeav_id'));
|
||||
}
|
||||
|
||||
protected function getObjectLabel($object) {
|
||||
protected function getObjectLabel($object)
|
||||
{
|
||||
return $object->getTitle();
|
||||
}
|
||||
|
||||
protected function getObjectId($object) {
|
||||
protected function getObjectId($object)
|
||||
{
|
||||
return $object->getId();
|
||||
}
|
||||
|
||||
protected function getViewArguments() {
|
||||
protected function getViewArguments()
|
||||
{
|
||||
return array(
|
||||
'attribute_id' => $this->getRequest()->get('attribute_id'),
|
||||
'order' => $this->getCurrentListOrder()
|
||||
);
|
||||
}
|
||||
|
||||
protected function renderListTemplate($currentOrder) {
|
||||
protected function renderListTemplate($currentOrder)
|
||||
{
|
||||
// We always return to the attribute edition form
|
||||
return $this->render(
|
||||
'attribute-edit',
|
||||
@@ -158,12 +171,14 @@ class AttributeAvController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function renderEditionTemplate() {
|
||||
protected function renderEditionTemplate()
|
||||
{
|
||||
// We always return to the attribute edition form
|
||||
return $this->render('attribute-edit', $this->getViewArguments());
|
||||
}
|
||||
|
||||
protected function redirectToEditionTemplate() {
|
||||
protected function redirectToEditionTemplate()
|
||||
{
|
||||
// We always return to the attribute edition form
|
||||
$this->redirectToRoute(
|
||||
"admin.configuration.attributes.update",
|
||||
@@ -171,7 +186,8 @@ class AttributeAvController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function redirectToListTemplate() {
|
||||
protected function redirectToListTemplate()
|
||||
{
|
||||
$this->redirectToRoute(
|
||||
"admin.configuration.attributes.update",
|
||||
$this->getViewArguments()
|
||||
|
||||
@@ -31,6 +31,10 @@ use Thelia\Model\AttributeQuery;
|
||||
use Thelia\Form\AttributeModificationForm;
|
||||
use Thelia\Form\AttributeCreationForm;
|
||||
use Thelia\Core\Event\UpdatePositionEvent;
|
||||
use Thelia\Model\AttributeAv;
|
||||
use Thelia\Model\AttributeAvQuery;
|
||||
use Thelia\Core\Event\AttributeAvUpdateEvent;
|
||||
use Thelia\Core\Event\AttributeEvent;
|
||||
|
||||
/**
|
||||
* Manages attributes sent by mail
|
||||
@@ -39,10 +43,12 @@ use Thelia\Core\Event\UpdatePositionEvent;
|
||||
*/
|
||||
class AttributeController extends AbstractCrudController
|
||||
{
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
'attribute',
|
||||
'manual',
|
||||
'order',
|
||||
|
||||
'admin.configuration.attributes.view',
|
||||
'admin.configuration.attributes.create',
|
||||
@@ -57,15 +63,18 @@ class AttributeController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function getCreationForm() {
|
||||
protected function getCreationForm()
|
||||
{
|
||||
return new AttributeCreationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getUpdateForm() {
|
||||
protected function getUpdateForm()
|
||||
{
|
||||
return new AttributeModificationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getCreationEvent($formData) {
|
||||
protected function getCreationEvent($formData)
|
||||
{
|
||||
$createEvent = new AttributeCreateEvent();
|
||||
|
||||
$createEvent
|
||||
@@ -77,8 +86,8 @@ class AttributeController extends AbstractCrudController
|
||||
return $createEvent;
|
||||
}
|
||||
|
||||
protected function getUpdateEvent($formData) {
|
||||
|
||||
protected function getUpdateEvent($formData)
|
||||
{
|
||||
$changeEvent = new AttributeUpdateEvent($formData['id']);
|
||||
|
||||
// Create and dispatch the change event
|
||||
@@ -93,8 +102,33 @@ class AttributeController extends AbstractCrudController
|
||||
return $changeEvent;
|
||||
}
|
||||
|
||||
protected function createUpdatePositionEvent($positionChangeMode, $positionValue) {
|
||||
/**
|
||||
* Process the attributes values (fix it in future version to integrate it in the attribute form as a collection)
|
||||
*
|
||||
* @see \Thelia\Controller\Admin\AbstractCrudController::performAdditionalUpdateAction()
|
||||
*/
|
||||
protected function performAdditionalUpdateAction($updateEvent)
|
||||
{
|
||||
$attr_values = $this->getRequest()->get('attribute_values', null);
|
||||
|
||||
if ($attr_values !== null) {
|
||||
|
||||
foreach($attr_values as $id => $value) {
|
||||
|
||||
$event = new AttributeAvUpdateEvent($id);
|
||||
|
||||
$event->setTitle($value);
|
||||
$event->setLocale($this->getCurrentEditionLocale());
|
||||
|
||||
$this->dispatch(TheliaEvents::ATTRIBUTE_AV_UPDATE, $event);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
|
||||
{
|
||||
return new UpdatePositionEvent(
|
||||
$this->getRequest()->get('attribute_id', null),
|
||||
$positionChangeMode,
|
||||
@@ -102,15 +136,18 @@ class AttributeController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function getDeleteEvent() {
|
||||
protected function getDeleteEvent()
|
||||
{
|
||||
return new AttributeDeleteEvent($this->getRequest()->get('attribute_id'));
|
||||
}
|
||||
|
||||
protected function eventContainsObject($event) {
|
||||
protected function eventContainsObject($event)
|
||||
{
|
||||
return $event->hasAttribute();
|
||||
}
|
||||
|
||||
protected function hydrateObjectForm($object) {
|
||||
protected function hydrateObjectForm($object)
|
||||
{
|
||||
|
||||
$data = array(
|
||||
'id' => $object->getId(),
|
||||
@@ -121,44 +158,132 @@ class AttributeController extends AbstractCrudController
|
||||
'postscriptum' => $object->getPostscriptum()
|
||||
);
|
||||
|
||||
// Setup attributes values
|
||||
/*
|
||||
* FIXME : doesn't work. "We get a This form should not contain extra fields." error
|
||||
$attr_av_list = AttributeAvQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->filterByAttributeId($object->getId())
|
||||
->find();
|
||||
|
||||
$attr_array = array();
|
||||
|
||||
foreach($attr_av_list as $attr_av) {
|
||||
$attr_array[$attr_av->getId()] = $attr_av->getTitle();
|
||||
}
|
||||
|
||||
$data['attribute_values'] = $attr_array;
|
||||
*/
|
||||
|
||||
// Setup the object form
|
||||
return new AttributeModificationForm($this->getRequest(), "form", $data);
|
||||
}
|
||||
|
||||
protected function getObjectFromEvent($event) {
|
||||
protected function getObjectFromEvent($event)
|
||||
{
|
||||
return $event->hasAttribute() ? $event->getAttribute() : null;
|
||||
}
|
||||
|
||||
protected function getExistingObject() {
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return AttributeQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('attribute_id'));
|
||||
}
|
||||
|
||||
protected function getObjectLabel($object) {
|
||||
protected function getObjectLabel($object)
|
||||
{
|
||||
return $object->getTitle();
|
||||
}
|
||||
|
||||
protected function getObjectId($object) {
|
||||
protected function getObjectId($object)
|
||||
{
|
||||
return $object->getId();
|
||||
}
|
||||
|
||||
protected function renderListTemplate($currentOrder) {
|
||||
protected function renderListTemplate($currentOrder)
|
||||
{
|
||||
return $this->render('attributes', array('order' => $currentOrder));
|
||||
}
|
||||
|
||||
protected function renderEditionTemplate() {
|
||||
return $this->render('attribute-edit', array('attribute_id' => $this->getRequest()->get('attribute_id')));
|
||||
}
|
||||
|
||||
protected function redirectToEditionTemplate() {
|
||||
$this->redirectToRoute(
|
||||
"admin.configuration.attributes.update",
|
||||
array('attribute_id' => $this->getRequest()->get('attribute_id'))
|
||||
protected function renderEditionTemplate()
|
||||
{
|
||||
return $this->render(
|
||||
'attribute-edit',
|
||||
array(
|
||||
'attribute_id' => $this->getRequest()->get('attribute_id'),
|
||||
'attributeav_order' => $this->getAttributeAvListOrder()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function redirectToListTemplate() {
|
||||
protected function redirectToEditionTemplate()
|
||||
{
|
||||
$this->redirectToRoute(
|
||||
"admin.configuration.attributes.update",
|
||||
array(
|
||||
'attribute_id' => $this->getRequest()->get('attribute_id'),
|
||||
'attributeav_order' => $this->getAttributeAvListOrder()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function redirectToListTemplate()
|
||||
{
|
||||
$this->redirectToRoute('admin.configuration.attributes.default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Attribute value list order.
|
||||
*
|
||||
* @return string the current list order
|
||||
*/
|
||||
protected function getAttributeAvListOrder()
|
||||
{
|
||||
return $this->getListOrderFromSession(
|
||||
'attributeav',
|
||||
'attributeav_order',
|
||||
'manual'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or Remove from all product templates
|
||||
*/
|
||||
protected function addRemoveFromAllTemplates($eventType)
|
||||
{
|
||||
// Check current user authorization
|
||||
if (null !== $response = $this->checkAuth("admin.configuration.attributes.update")) return $response;
|
||||
|
||||
try {
|
||||
if (null !== $object = $this->getExistingObject()) {
|
||||
|
||||
$event = new AttributeEvent($object);
|
||||
|
||||
$this->dispatch($eventType, $event);
|
||||
}
|
||||
}
|
||||
catch (\Exception $ex) {
|
||||
// Any error
|
||||
return $this->errorPage($ex);
|
||||
}
|
||||
|
||||
$this->redirectToListTemplate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove from all product templates
|
||||
*/
|
||||
public function removeFromAllTemplates()
|
||||
{
|
||||
return $this->addRemoveFromAllTemplates(TheliaEvents::ATTRIBUTE_REMOVE_FROM_ALL_TEMPLATES);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add to all product templates
|
||||
*/
|
||||
public function addToAllTemplates()
|
||||
{
|
||||
return $this->addRemoveFromAllTemplates(TheliaEvents::ATTRIBUTE_ADD_TO_ALL_TEMPLATES);
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,8 @@ use Thelia\Form\BaseForm;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Log\Tlog;
|
||||
use Symfony\Component\Routing\Router;
|
||||
use Thelia\Model\Admin;
|
||||
use Thelia\Core\Security\Token\CookieTokenProvider;
|
||||
|
||||
class BaseAdminController extends BaseController
|
||||
{
|
||||
@@ -97,7 +99,7 @@ class BaseAdminController extends BaseController
|
||||
protected function errorPage($message)
|
||||
{
|
||||
if ($message instanceof \Exception) {
|
||||
$message = sprintf($this->getTranslator()->trans("Sorry, an error occured: %msg"), array('msg' => $message->getMessage()));
|
||||
$message = $this->getTranslator()->trans("Sorry, an error occured: %msg", array('%msg' => $message->getMessage()));
|
||||
}
|
||||
|
||||
return $this->render('general_error', array(
|
||||
@@ -273,6 +275,75 @@ class BaseAdminController extends BaseController
|
||||
return $this->getCurrentEditionLang()->getLocale();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the current list order identifier for a given object name,
|
||||
* updating in using the current request.
|
||||
*
|
||||
* @param unknown $objectName the object name (e.g. 'attribute', 'message')
|
||||
* @param unknown $requestParameterName the name of the request parameter that defines the list order
|
||||
* @param unknown $defaultListOrder the default order to use, if none is defined
|
||||
* @param string $updateSession if true, the session will be updated with the current order.
|
||||
*
|
||||
* @return String the current liste order.
|
||||
*/
|
||||
protected function getListOrderFromSession($objectName, $requestParameterName, $defaultListOrder, $updateSession = true) {
|
||||
|
||||
$order = $defaultListOrder;
|
||||
|
||||
$orderSessionIdentifier = sprintf("admin.%s.currentListOrder", $objectName);
|
||||
|
||||
// Find the current order
|
||||
$order = $this->getRequest()->get(
|
||||
$requestParameterName,
|
||||
$this->getSession()->get($orderSessionIdentifier, $defaultListOrder)
|
||||
);
|
||||
|
||||
if ($updateSession) $this->getSession()->set($orderSessionIdentifier, $order);
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the remember me cookie for the given user.
|
||||
*/
|
||||
protected function createAdminRememberMeCookie(Admin $user)
|
||||
{
|
||||
$ctp = new CookieTokenProvider();
|
||||
|
||||
$cookieName = ConfigQuery::read('admin_remember_me_cookie_name', 'armcn');
|
||||
$cookieExpiration = ConfigQuery::read('admin_remember_me_cookie_expiration', 2592000 /* 1 month */);
|
||||
|
||||
$ctp->createCookie($user, $cookieName, $cookieExpiration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the rememberme key from the cookie.
|
||||
*
|
||||
* @return string hte key found, or null if no key was found.
|
||||
*/
|
||||
protected function getRememberMeKeyFromCookie()
|
||||
{
|
||||
// Check if we can authenticate the user with a cookie-based token
|
||||
$cookieName = ConfigQuery::read('admin_remember_me_cookie_name', 'armcn');
|
||||
|
||||
$ctp = new CookieTokenProvider();
|
||||
|
||||
return $ctp->getKeyFromCookie($this->getRequest(), $cookieName);
|
||||
}
|
||||
|
||||
/** Clear the remember me cookie.
|
||||
*
|
||||
*/
|
||||
protected function clearRememberMeCookie() {
|
||||
|
||||
$ctp = new CookieTokenProvider();
|
||||
|
||||
$cookieName = ConfigQuery::read('admin_remember_me_cookie_name', 'armcn');
|
||||
|
||||
$ctp->clearCookie($cookieName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the given template, and returns the result as an Http Response.
|
||||
*
|
||||
@@ -314,7 +385,7 @@ class BaseAdminController extends BaseController
|
||||
'edit_language_id' => $edition_language->getId(),
|
||||
'edit_language_locale' => $edition_language->getLocale(),
|
||||
|
||||
'current_url' => htmlspecialchars($this->getRequest()->getUri())
|
||||
'current_url' => $this->getRequest()->getUri()
|
||||
));
|
||||
|
||||
// Update the current edition language in session
|
||||
|
||||
@@ -43,6 +43,7 @@ class ConfigController extends AbstractCrudController
|
||||
parent::__construct(
|
||||
'variable',
|
||||
'name',
|
||||
'order',
|
||||
|
||||
'admin.configuration.variables.view',
|
||||
'admin.configuration.variables.create',
|
||||
|
||||
@@ -43,6 +43,7 @@ class CurrencyController extends AbstractCrudController
|
||||
parent::__construct(
|
||||
'currency',
|
||||
'manual',
|
||||
'order',
|
||||
|
||||
'admin.configuration.currencies.view',
|
||||
'admin.configuration.currencies.create',
|
||||
|
||||
@@ -37,10 +37,12 @@ use Thelia\Form\MessageCreationForm;
|
||||
*/
|
||||
class MessageController extends AbstractCrudController
|
||||
{
|
||||
public function __construct() {
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
'message',
|
||||
null,
|
||||
null, // no sort order change
|
||||
null, // no sort order change
|
||||
|
||||
'admin.configuration.messages.view',
|
||||
'admin.configuration.messages.create',
|
||||
@@ -55,15 +57,18 @@ class MessageController extends AbstractCrudController
|
||||
);
|
||||
}
|
||||
|
||||
protected function getCreationForm() {
|
||||
protected function getCreationForm()
|
||||
{
|
||||
return new MessageCreationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getUpdateForm() {
|
||||
protected function getUpdateForm()
|
||||
{
|
||||
return new MessageModificationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getCreationEvent($formData) {
|
||||
protected function getCreationEvent($formData)
|
||||
{
|
||||
$createEvent = new MessageCreateEvent();
|
||||
|
||||
$createEvent
|
||||
@@ -76,7 +81,8 @@ class MessageController extends AbstractCrudController
|
||||
return $createEvent;
|
||||
}
|
||||
|
||||
protected function getUpdateEvent($formData) {
|
||||
protected function getUpdateEvent($formData)
|
||||
{
|
||||
$changeEvent = new MessageUpdateEvent($formData['id']);
|
||||
|
||||
// Create and dispatch the change event
|
||||
@@ -93,16 +99,18 @@ class MessageController extends AbstractCrudController
|
||||
return $changeEvent;
|
||||
}
|
||||
|
||||
protected function getDeleteEvent() {
|
||||
protected function getDeleteEvent()
|
||||
{
|
||||
return new MessageDeleteEvent($this->getRequest()->get('message_id'));
|
||||
}
|
||||
|
||||
protected function eventContainsObject($event) {
|
||||
protected function eventContainsObject($event)
|
||||
{
|
||||
return $event->hasMessage();
|
||||
}
|
||||
|
||||
protected function hydrateObjectForm($object) {
|
||||
|
||||
protected function hydrateObjectForm($object)
|
||||
{
|
||||
// Prepare the data that will hydrate the form
|
||||
$data = array(
|
||||
'id' => $object->getId(),
|
||||
@@ -119,40 +127,48 @@ class MessageController extends AbstractCrudController
|
||||
return new MessageModificationForm($this->getRequest(), "form", $data);
|
||||
}
|
||||
|
||||
protected function getObjectFromEvent($event) {
|
||||
protected function getObjectFromEvent($event)
|
||||
{
|
||||
return $event->hasMessage() ? $event->getMessage() : null;
|
||||
}
|
||||
|
||||
protected function getExistingObject() {
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return MessageQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('message_id'));
|
||||
}
|
||||
|
||||
protected function getObjectLabel($object) {
|
||||
protected function getObjectLabel($object)
|
||||
{
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
protected function getObjectId($object) {
|
||||
protected function getObjectId($object)
|
||||
{
|
||||
return $object->getId();
|
||||
}
|
||||
|
||||
protected function renderListTemplate($currentOrder) {
|
||||
protected function renderListTemplate($currentOrder)
|
||||
{
|
||||
return $this->render('messages');
|
||||
}
|
||||
|
||||
protected function renderEditionTemplate() {
|
||||
protected function renderEditionTemplate()
|
||||
{
|
||||
return $this->render('message-edit', array('message_id' => $this->getRequest()->get('message_id')));
|
||||
}
|
||||
|
||||
protected function redirectToEditionTemplate() {
|
||||
protected function redirectToEditionTemplate()
|
||||
{
|
||||
$this->redirectToRoute(
|
||||
"admin.configuration.messages.update",
|
||||
array('message_id' => $this->getRequest()->get('message_id'))
|
||||
);
|
||||
}
|
||||
|
||||
protected function redirectToListTemplate() {
|
||||
protected function redirectToListTemplate()
|
||||
{
|
||||
$this->redirectToRoute('admin.configuration.messages.default');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,11 +30,44 @@ use Thelia\Core\Security\Exception\AuthenticationException;
|
||||
use Thelia\Tools\URL;
|
||||
use Thelia\Tools\Redirect;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Core\Security\Authentication\AdminTokenAuthenticator;
|
||||
use Thelia\Core\Security\UserProvider\TokenProvider;
|
||||
use Symfony\Component\HttpFoundation\Cookie;
|
||||
use Thelia\Core\Security\UserProvider\CookieTokenProvider;
|
||||
use Thelia\Core\Security\Exception\TokenAuthenticationException;
|
||||
|
||||
class SessionController extends BaseAdminController
|
||||
{
|
||||
public function showLoginAction()
|
||||
{
|
||||
// Check if we can authenticate the user with a cookie-based token
|
||||
if (null !== $key = $this->getRememberMeKeyFromCookie()) {
|
||||
|
||||
// Create the authenticator
|
||||
$authenticator = new AdminTokenAuthenticator($key);
|
||||
|
||||
try {
|
||||
// If have found a user, store it in the security context
|
||||
$user = $authenticator->getAuthentifiedUser();
|
||||
|
||||
$this->getSecurityContext()->setAdminUser($user);
|
||||
|
||||
$this->adminLogAppend("Successful token authentication");
|
||||
|
||||
// Update the cookie
|
||||
$cookie = $this->createAdminRememberMeCookie($user);
|
||||
|
||||
// Render the home page
|
||||
return $this->render("home");
|
||||
}
|
||||
catch (TokenAuthenticationException $ex) {
|
||||
$this->adminLogAppend("Token based authentication failed.");
|
||||
|
||||
// Clear the cookie
|
||||
$this->clearRememberMeCookie();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render("login");
|
||||
}
|
||||
|
||||
@@ -44,6 +77,9 @@ class SessionController extends BaseAdminController
|
||||
|
||||
$this->getSecurityContext()->clearAdminUser();
|
||||
|
||||
// Clear the remember me cookie, if any
|
||||
$this->clearRememberMeCookie();
|
||||
|
||||
// Go back to login page.
|
||||
$this->redirectToRoute('admin.login');
|
||||
}
|
||||
@@ -68,10 +104,19 @@ class SessionController extends BaseAdminController
|
||||
// Log authentication success
|
||||
AdminLog::append("Authentication successful", $request, $user);
|
||||
|
||||
/**
|
||||
* FIXME: we have tou find a way to send cookie
|
||||
*/
|
||||
if (intval($adminLoginForm->getForm()->get('remember_me')->getData()) > 0) {
|
||||
// If a remember me field if present and set in the form, create
|
||||
// the cookie thant store "remember me" information
|
||||
$this->createAdminRememberMeCookie($user);
|
||||
}
|
||||
|
||||
$this->dispatch(TheliaEvents::ADMIN_LOGIN);
|
||||
|
||||
// Redirect to the success URL
|
||||
return Redirect::exec($adminLoginForm->getSuccessUrl());
|
||||
// Redirect to the success URL, passing the cookie if one exists.
|
||||
$this->redirect($adminLoginForm->getSuccessUrl());
|
||||
|
||||
} catch (FormValidationException $ex) {
|
||||
|
||||
|
||||
196
core/lib/Thelia/Controller/Admin/TemplateController.php
Normal file
196
core/lib/Thelia/Controller/Admin/TemplateController.php
Normal file
@@ -0,0 +1,196 @@
|
||||
<?php
|
||||
/*************************************************************************************/
|
||||
/* */
|
||||
/* Thelia */
|
||||
/* */
|
||||
/* Copyright (c) OpenStudio */
|
||||
/* email : info@thelia.net */
|
||||
/* web : http://www.thelia.net */
|
||||
/* */
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
/* it under the terms of the GNU General Public License as published by */
|
||||
/* the Free Software Foundation; either version 3 of the License */
|
||||
/* */
|
||||
/* This program is distributed in the hope that it will be useful, */
|
||||
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
||||
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
||||
/* 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 <http://www.gnu.org/licenses/>. */
|
||||
/* */
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Controller\Admin;
|
||||
|
||||
use Thelia\Core\Event\TemplateDeleteEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Core\Event\TemplateUpdateEvent;
|
||||
use Thelia\Core\Event\TemplateCreateEvent;
|
||||
use Thelia\Model\TemplateQuery;
|
||||
use Thelia\Form\TemplateModificationForm;
|
||||
use Thelia\Form\TemplateCreationForm;
|
||||
use Thelia\Core\Event\UpdatePositionEvent;
|
||||
use Thelia\Model\TemplateAv;
|
||||
use Thelia\Model\TemplateAvQuery;
|
||||
use Thelia\Core\Event\TemplateAvUpdateEvent;
|
||||
use Thelia\Core\Event\TemplateEvent;
|
||||
|
||||
/**
|
||||
* Manages templates sent by mail
|
||||
*
|
||||
* @author Franck Allimant <franck@cqfdev.fr>
|
||||
*/
|
||||
class TemplateController extends AbstractCrudController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
'template',
|
||||
null,
|
||||
null,
|
||||
|
||||
'admin.configuration.templates.view',
|
||||
'admin.configuration.templates.create',
|
||||
'admin.configuration.templates.update',
|
||||
'admin.configuration.templates.delete',
|
||||
|
||||
TheliaEvents::TEMPLATE_CREATE,
|
||||
TheliaEvents::TEMPLATE_UPDATE,
|
||||
TheliaEvents::TEMPLATE_DELETE,
|
||||
null, // No visibility toggle
|
||||
null // No position update
|
||||
);
|
||||
}
|
||||
|
||||
protected function getCreationForm()
|
||||
{
|
||||
return new TemplateCreationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getUpdateForm()
|
||||
{
|
||||
return new TemplateModificationForm($this->getRequest());
|
||||
}
|
||||
|
||||
protected function getCreationEvent($formData)
|
||||
{
|
||||
$createEvent = new TemplateCreateEvent();
|
||||
|
||||
$createEvent
|
||||
->setTemplateName($formData['name'])
|
||||
->setLocale($formData["locale"])
|
||||
;
|
||||
|
||||
return $createEvent;
|
||||
}
|
||||
|
||||
protected function getUpdateEvent($formData)
|
||||
{
|
||||
$changeEvent = new TemplateUpdateEvent($formData['id']);
|
||||
|
||||
// Create and dispatch the change event
|
||||
$changeEvent
|
||||
->setLocale($formData["locale"])
|
||||
->setTemplateName($formData['name'])
|
||||
;
|
||||
|
||||
// Add feature and attributes list
|
||||
|
||||
return $changeEvent;
|
||||
}
|
||||
|
||||
protected function getDeleteEvent()
|
||||
{
|
||||
return new TemplateDeleteEvent($this->getRequest()->get('template_id'));
|
||||
}
|
||||
|
||||
protected function eventContainsObject($event)
|
||||
{
|
||||
return $event->hasTemplate();
|
||||
}
|
||||
|
||||
protected function hydrateObjectForm($object)
|
||||
{
|
||||
|
||||
$data = array(
|
||||
'id' => $object->getId(),
|
||||
'locale' => $object->getLocale(),
|
||||
'name' => $object->getName()
|
||||
);
|
||||
|
||||
// Setup the object form
|
||||
return new TemplateModificationForm($this->getRequest(), "form", $data);
|
||||
}
|
||||
|
||||
protected function getObjectFromEvent($event)
|
||||
{
|
||||
return $event->hasTemplate() ? $event->getTemplate() : null;
|
||||
}
|
||||
|
||||
protected function getExistingObject()
|
||||
{
|
||||
return TemplateQuery::create()
|
||||
->joinWithI18n($this->getCurrentEditionLocale())
|
||||
->findOneById($this->getRequest()->get('template_id'));
|
||||
}
|
||||
|
||||
protected function getObjectLabel($object)
|
||||
{
|
||||
return $object->getName();
|
||||
}
|
||||
|
||||
protected function getObjectId($object)
|
||||
{
|
||||
return $object->getId();
|
||||
}
|
||||
|
||||
protected function renderListTemplate($currentOrder)
|
||||
{
|
||||
return $this->render('templates', array('order' => $currentOrder));
|
||||
}
|
||||
|
||||
protected function renderEditionTemplate()
|
||||
{
|
||||
return $this->render(
|
||||
'template-edit',
|
||||
array(
|
||||
'template_id' => $this->getRequest()->get('template_id'),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function redirectToEditionTemplate()
|
||||
{
|
||||
$this->redirectToRoute(
|
||||
"admin.configuration.templates.update",
|
||||
array(
|
||||
'template_id' => $this->getRequest()->get('template_id'),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
protected function redirectToListTemplate()
|
||||
{
|
||||
$this->redirectToRoute('admin.configuration.templates.default');
|
||||
}
|
||||
|
||||
// Process delete failure, which may occurs if template is in use.
|
||||
protected function performAdditionalDeleteAction($deleteEvent)
|
||||
{
|
||||
if ($deleteEvent->getProductCount() > 0) {
|
||||
|
||||
$this->getParserContext()->setGeneralError(
|
||||
$this->getTranslator()->trans(
|
||||
"This template is in use in some of your products, and cannot be deleted. Delete it from all your products and try again."
|
||||
)
|
||||
);
|
||||
|
||||
return $this->renderList();
|
||||
}
|
||||
|
||||
// Normal delete processing
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -198,9 +198,9 @@ class BaseController extends ContainerAware
|
||||
*
|
||||
* @param string $url
|
||||
*/
|
||||
public function redirect($url, $status = 302)
|
||||
public function redirect($url, $status = 302, $cookies = array())
|
||||
{
|
||||
Redirect::exec($url, $status);
|
||||
Redirect::exec($url, $status, $cookies);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -23,11 +23,12 @@
|
||||
|
||||
namespace Thelia\Controller\Front;
|
||||
use Thelia\Core\Event\AddressCreateOrUpdateEvent;
|
||||
use Thelia\Core\Event\AddressEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Form\AddressCreateForm;
|
||||
use Thelia\Form\AddressUpdateForm;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Model\Base\AddressQuery;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\Customer;
|
||||
use Thelia\Tools\URL;
|
||||
|
||||
@@ -46,14 +47,13 @@ class AddressController extends BaseFrontController
|
||||
*/
|
||||
public function generateModalAction($address_id)
|
||||
{
|
||||
if ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->accessDenied();
|
||||
}
|
||||
|
||||
$this->checkAuth();
|
||||
$this->checkXmlHttpRequest();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create controller.
|
||||
* Check if customer is logged in
|
||||
@@ -62,9 +62,7 @@ class AddressController extends BaseFrontController
|
||||
*/
|
||||
public function createAction()
|
||||
{
|
||||
if ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->accessDenied()
|
||||
}
|
||||
$this->checkAuth();
|
||||
|
||||
$addressCreate = new AddressCreateForm($this->getRequest());
|
||||
|
||||
@@ -96,20 +94,28 @@ class AddressController extends BaseFrontController
|
||||
}
|
||||
}
|
||||
|
||||
public function updateAction()
|
||||
public function updateViewAction($address_id)
|
||||
{
|
||||
$this->checkAuth();
|
||||
|
||||
$customer = $this->getSecurityContext()->getCustomerUser();
|
||||
$address = AddressQuery::create()->findPk($address_id);
|
||||
|
||||
if(!$address || $customer->getId() != $address->getCustomerId()) {
|
||||
$this->redirectToRoute("home");
|
||||
}
|
||||
|
||||
$this->getParserContext()->set("address_id", $address_id);
|
||||
}
|
||||
|
||||
public function processUpdateAction($address_id)
|
||||
{
|
||||
$this->checkAuth();
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->redirectToRoute("home");
|
||||
}
|
||||
|
||||
if (null === $address_id = $request->get("address_id")) {
|
||||
$this->redirectToRoute("home");
|
||||
}
|
||||
|
||||
$addressUpdate = new AddressUpdateForm($request);
|
||||
|
||||
|
||||
try {
|
||||
$customer = $this->getSecurityContext()->getCustomerUser();
|
||||
|
||||
@@ -136,7 +142,7 @@ class AddressController extends BaseFrontController
|
||||
} catch (\Exception $e) {
|
||||
$message = sprintf("Sorry, an error occured: %s", $e->getMessage());
|
||||
}
|
||||
|
||||
$this->getParserContext()->set("address_id", $address_id);
|
||||
if ($message !== false) {
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("Error during address creation process : %s", $message));
|
||||
|
||||
@@ -149,6 +155,22 @@ class AddressController extends BaseFrontController
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteAction($address_id)
|
||||
{
|
||||
$this->checkAuth();
|
||||
|
||||
$customer = $this->getSecurityContext()->getCustomerUser();
|
||||
$address = AddressQuery::create()->findPk($address_id);
|
||||
|
||||
if(!$address || $customer->getId() != $address->getCustomerId()) {
|
||||
$this->redirectToRoute("home");
|
||||
}
|
||||
|
||||
$this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address));
|
||||
|
||||
$this->redirectToRoute("customer.account.view");
|
||||
}
|
||||
|
||||
protected function createAddressEvent($form)
|
||||
{
|
||||
return new AddressCreateOrUpdateEvent(
|
||||
@@ -164,7 +186,8 @@ class AddressController extends BaseFrontController
|
||||
$form->get("country")->getData(),
|
||||
$form->get("cellphone")->getData(),
|
||||
$form->get("phone")->getData(),
|
||||
$form->get("company")->getData()
|
||||
$form->get("company")->getData(),
|
||||
$form->get("is_default")->getData()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,4 +50,11 @@ class BaseFrontController extends BaseController
|
||||
{
|
||||
$this->redirect(URL::getInstance()->absoluteUrl($this->getRoute($routeId, array(), $referenceType), $urlParameters));
|
||||
}
|
||||
|
||||
public function checkAuth()
|
||||
{
|
||||
if($this->getSecurityContext()->hasCustomerUser() === false) {
|
||||
$this->redirectToRoute("customer.login.view");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class BaseInstallController extends BaseController
|
||||
{
|
||||
$parser = $this->container->get("thelia.parser");
|
||||
|
||||
// Define the template thant shoud be used
|
||||
// Define the template that shoud be used
|
||||
$parser->setTemplate("install");
|
||||
|
||||
return $parser;
|
||||
|
||||
@@ -33,18 +33,61 @@ class InstallController extends BaseInstallController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$this->verifyStep(1);
|
||||
//$this->verifyStep(1);
|
||||
|
||||
$this->getSession()->set("step", 1);
|
||||
|
||||
$this->render("index.html");
|
||||
return $this->render("index.html");
|
||||
}
|
||||
|
||||
public function checkPermission()
|
||||
{
|
||||
$this->verifyStep(2);
|
||||
//$this->verifyStep(2);
|
||||
|
||||
$permission = new CheckPermission();
|
||||
//$permission = new CheckPermission();
|
||||
|
||||
$this->getSession()->set("step", 2);
|
||||
return $this->render("step-2.html");
|
||||
}
|
||||
|
||||
public function databaseConnection()
|
||||
{
|
||||
//$this->verifyStep(2);
|
||||
|
||||
//$permission = new CheckPermission();
|
||||
|
||||
$this->getSession()->set("step", 3);
|
||||
return $this->render("step-3.html");
|
||||
}
|
||||
|
||||
public function databaseSelection()
|
||||
{
|
||||
//$this->verifyStep(2);
|
||||
|
||||
//$permission = new CheckPermission();
|
||||
|
||||
$this->getSession()->set("step", 4);
|
||||
return $this->render("step-4.html");
|
||||
}
|
||||
|
||||
public function generalInformation()
|
||||
{
|
||||
//$this->verifyStep(2);
|
||||
|
||||
//$permission = new CheckPermission();
|
||||
|
||||
$this->getSession()->set("step", 5);
|
||||
return $this->render("step-5.html");
|
||||
}
|
||||
|
||||
public function thanks()
|
||||
{
|
||||
//$this->verifyStep(2);
|
||||
|
||||
//$permission = new CheckPermission();
|
||||
|
||||
$this->getSession()->set("step", 6);
|
||||
return $this->render("thanks.html");
|
||||
}
|
||||
|
||||
protected function verifyStep($step)
|
||||
|
||||
Reference in New Issue
Block a user