diff --git a/core/lib/Thelia/Config/Resources/routing/install.xml b/core/lib/Thelia/Config/Resources/routing/install.xml index fb5c25bcc..d53763948 100644 --- a/core/lib/Thelia/Config/Resources/routing/install.xml +++ b/core/lib/Thelia/Config/Resources/routing/install.xml @@ -8,4 +8,8 @@ Thelia\Controller\Install\InstallController::index + + Thelia\Controller\Install\InstallController::checkPermission + + diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index c7c9f6f14..d4c8b5854 100755 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -179,7 +179,7 @@ class BaseController extends ContainerAware */ public function redirect($url) { - Redirect::exec($url); + Redirect::exec(URL::absoluteUrl($url)); } /** diff --git a/core/lib/Thelia/Controller/Install/InstallController.php b/core/lib/Thelia/Controller/Install/InstallController.php index 0c7770e4b..209eea82b 100644 --- a/core/lib/Thelia/Controller/Install/InstallController.php +++ b/core/lib/Thelia/Controller/Install/InstallController.php @@ -23,6 +23,7 @@ namespace Thelia\Controller\Install; use Thelia\Install\BaseInstall; +use Thelia\Install\CheckPermission; /** * Class InstallController @@ -33,6 +34,36 @@ class InstallController extends BaseInstallController { public function index() { + $this->verifyStep(1); + + $this->getSession()->set("step", 1); + $this->render("index.html"); } + + public function checkPermission() + { + $this->verifyStep(2); + + $permission = new CheckPermission(); + } + + protected function verifyStep($step) + { + $session = $this->getSession(); + + if ($session->has("step")) { + $sessionStep = $session->get("step"); + } else { + return true; + } + + switch($step) { + case "1" : + if ($sessionStep > 1) { + $this->redirect("/install/step/2"); + } + break; + } + } } \ No newline at end of file diff --git a/templates/install/index.html b/templates/install/index.html index 888f8b943..a996cc241 100644 --- a/templates/install/index.html +++ b/templates/install/index.html @@ -1,4 +1,12 @@ {extends file="layout.html"} {block name="content"} - Hello World ! +

{intl l="Thelia installation wizard"}

+
+ + {intl l="Bienvenue au sein du programme d'installation de Thelia."}
+ {intl l="Nous allons vous guider tout au long de ce processus afin d'installer l'application sur votre système."}

+ +
+ +
{/block} \ No newline at end of file