summaryrefslogtreecommitdiff
path: root/installer/index.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-05-22 08:37:08 +0200
committerAleksander Machniak <alec@alec.pl>2012-05-22 08:38:43 +0200
commit5fed074a45cb9f3a7e4ade86166a0f04d05243b7 (patch)
tree5e38c797e03f539f5de0ca0668d7c6d438891cd0 /installer/index.php
parent38184e911363dd8c2bd4c93b7d3f3dde27be8e61 (diff)
Always use 1 step as a fallback (#1488490)
Diffstat (limited to 'installer/index.php')
-rw-r--r--installer/index.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/installer/index.php b/installer/index.php
index e46ef19df..b5b9e4a04 100644
--- a/installer/index.php
+++ b/installer/index.php
@@ -130,14 +130,23 @@ if ($RCI->configured && empty($_REQUEST['_step'])) {
echo '</div></body></html>';
exit;
}
-
+
?>
<h1>Roundcube Webmail Installer</h1>
<ol id="progress">
<?php
-
+ $include_steps = array(
+ 1 => './check.php',
+ 2 => './config.php',
+ 3 => './test.php',
+ );
+
+ if (!in_array($RCI->step, array_keys($include_steps))) {
+ $RCI->step = 1;
+ }
+
foreach (array('Check environment', 'Create config', 'Test config') as $i => $item) {
$j = $i + 1;
$link = ($RCI->step >= $j || $RCI->configured) ? '<a href="./index.php?_step='.$j.'">' . Q($item) . '</a>' : Q($item);
@@ -147,15 +156,8 @@ if ($RCI->configured && empty($_REQUEST['_step'])) {
</ol>
<?php
-$include_steps = array('', './check.php', './config.php', './test.php');
-if ($include_steps[$RCI->step]) {
- include $include_steps[$RCI->step];
-}
-else {
- header("HTTP/1.0 404 Not Found");
- echo '<h2 class="error">Invalid step</h2>';
-}
+include $include_steps[$RCI->step];
?>
</div>