Kaynağa Gözat

Disable direct access to installer

ohartl 9 yıl önce
ebeveyn
işleme
c3c78de871

+ 1 - 0
installer/.htaccess

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

+ 10 - 0
installer/index.php

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

+ 8 - 0
installer/step0.php

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

+ 6 - 0
installer/step1.php

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

+ 6 - 0
installer/step2.php

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

+ 6 - 0
installer/step3.php

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

+ 6 - 0
installer/step4.php

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

+ 6 - 0
installer/step5.php

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

+ 6 - 0
installer/step6.php

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

+ 6 - 0
installer/step7.php

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