initialize step 2
This commit is contained in:
@@ -8,4 +8,8 @@
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::index</default>
|
||||
</route>
|
||||
|
||||
<route id="home" path="/install/step/2" >
|
||||
<default key="_controller">Thelia\Controller\Install\InstallController::checkPermission</default>
|
||||
</route>
|
||||
|
||||
</routes>
|
||||
|
||||
@@ -179,7 +179,7 @@ class BaseController extends ContainerAware
|
||||
*/
|
||||
public function redirect($url)
|
||||
{
|
||||
Redirect::exec($url);
|
||||
Redirect::exec(URL::absoluteUrl($url));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,12 @@
|
||||
{extends file="layout.html"}
|
||||
{block name="content"}
|
||||
Hello World !
|
||||
<h1>{intl l="Thelia installation wizard"}</h1>
|
||||
<br />
|
||||
|
||||
{intl l="Bienvenue au sein du programme d'installation de Thelia."}<br />
|
||||
{intl l="Nous allons vous guider tout au long de ce processus afin d'installer l'application sur votre système."}<br /><br />
|
||||
|
||||
<form action="{url path="/install/step/2" }" method="post">
|
||||
<input type="submit" value="Continuer" />
|
||||
</form>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user