Correct link "Go to admin page" alike thelia is installed in the root of virtual host or in a subdirectory

This commit is contained in:
Nicolas Villa
2013-11-26 18:09:48 +01:00
parent 657cd95f3b
commit 74b391efee

View File

@@ -58,6 +58,11 @@ $fs->remove(THELIA_ROOT . '/cache/dev');
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
$_SESSION['install']['step'] = $step;
// Retrieve the website url
$url = $_SERVER['PHP_SELF'];
$website_url = preg_replace("#/install/[a-z](.*)#" ,'', $url);
?>
<div class="well">
@@ -69,8 +74,8 @@ $_SESSION['install']['step'] = $step;
</p>
<p class="lead text-center">
<a href="<?php echo $request->getSchemeAndHttpHost(); ?>/admin">Go to back office</a>
<a href="<?php echo $request->getSchemeAndHttpHost().$website_url; ?>/admin">Go to back office</a>
</p>
</div>
<?php include "footer.php"; ?>
<?php include "footer.php"; ?>