Disable direct access to installer
This commit is contained in:
parent
75161b2d8b
commit
c3c78de871
10 changed files with 61 additions and 0 deletions
1
installer/.htaccess
Normal file
1
installer/.htaccess
Normal file
|
@ -0,0 +1 @@
|
|||
Deny from all
|
|
@ -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>';
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
|
||||
die('You cannot directly access the installer files.');
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
$thisStep = 1;
|
||||
|
||||
$error = null;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
|
||||
die('You cannot directly access the installer files.');
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
$thisStep = 2;
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
|
||||
die('You cannot directly access the installer files.');
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
$thisStep = 4;
|
||||
|
||||
$error = null;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
|
||||
die('You cannot directly access the installer files.');
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
$thisStep = 5;
|
||||
|
||||
$error = null;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
|
||||
die('You cannot directly access the installer files.');
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
$thisStep = 6;
|
||||
|
||||
$error = null;
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<?php
|
||||
|
||||
if(strpos($_SERVER['REQUEST_URI'], 'installer/') !== false){
|
||||
die('You cannot directly access the installer files.');
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
|
||||
$thisStep = 7;
|
||||
|
||||
$error = '';
|
||||
|
|
Loading…
Add table
Reference in a new issue