Merge pull request #113 from Boyquotes/master

Correct link during the installation process and config url website
This commit is contained in:
Manuel Raynaud
2013-11-27 01:10:10 -08:00
3 changed files with 14 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ if (!file_exists(THELIA_CONF_DIR . 'database.yml') && !defined('THELIA_INSTALL_M
define('THELIA_INSTALL_MODE', true); define('THELIA_INSTALL_MODE', true);
} else { } else {
$request = \Thelia\Core\HttpFoundation\Request::createFromGlobals(); $request = \Thelia\Core\HttpFoundation\Request::createFromGlobals();
header('location: '.$request->getSchemeAndHttpHost() . '/install'); header('location: '.$request->getUriForPath() . '/install');
exit; exit;
} }
} }

View File

@@ -73,6 +73,10 @@ if (!$err && $_SESSION['install']['step'] != $step) {
$_SESSION['install']['step'] = $step; $_SESSION['install']['step'] = $step;
// Retrieve the website url
$url = $_SERVER['PHP_SELF'];
$website_url = preg_replace("#/install/[a-z](.*)#" ,'', $url);
?> ?>
<form action="end.php" method="POST" > <form action="end.php" method="POST" >
<div class="well"> <div class="well">
@@ -98,7 +102,7 @@ $_SESSION['install']['step'] = $step;
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="site_name">website url :</label> <label for="site_name">website url :</label>
<input id="site_name" class="form-control" type="text" name="url_site" placeholder="" value="http://<?php echo $_SERVER['SERVER_NAME']; ?>" required> <input id="site_name" class="form-control" type="text" name="url_site" placeholder="" value="http://<?php echo $_SERVER['SERVER_NAME'].$website_url; ?>" required>
</div> </div>
<div class="clearfix"> <div class="clearfix">
<div class="control-btn"> <div class="control-btn">

View File

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