Disable direct access to installer

This commit is contained in:
ohartl 2016-05-19 19:05:41 +02:00
parent 75161b2d8b
commit c3c78de871
10 changed files with 61 additions and 0 deletions

1
installer/.htaccess Normal file
View file

@ -0,0 +1 @@
Deny from all

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
define('INSTALLER_MAX_STEP', 6);
define('INSTALLER_TYPE_CREATE', 0);
@ -26,6 +32,8 @@ $installerStepMapping = array(
7 => 6,
);
/*-----------------------------------------------------------------------------*/
function installer_reset()
{
global $_SESSION;
@ -78,6 +86,8 @@ if(!isset($_SESSION['installer'])){
installer_reset();
}
/*-----------------------------------------------------------------------------*/
$step = (isset($_GET['step']) && is_numeric($_GET['step'])) ? intval($_GET['step']) : 0;
echo '<h1>Installation of WebMUM</h1>';

View file

@ -1,7 +1,14 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 0;
/*-----------------------------------------------------------------------------*/
$requirements = array();
$numberOfRequirements = 5;
@ -21,6 +28,7 @@ if(file_exists('config') && file_exists('config/config.php.example')){
$requirements[] = 'config_example';
}
/*-----------------------------------------------------------------------------*/
if(isset($_GET['go']) && $_GET['go'] == 'next'){
if(count($requirements) === $numberOfRequirements){

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 1;
$error = null;

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 2;
/*-----------------------------------------------------------------------------*/

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 3;
if($_SESSION['installer']['lastStep'] > $thisStep){

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 4;
$error = null;

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 5;
$error = null;

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 6;
$error = null;

View file

@ -1,5 +1,11 @@
<?php
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
die('You cannot directly access the installer files.');
}
/*-----------------------------------------------------------------------------*/
$thisStep = 7;
$error = '';