[Vtigercrm-commits] [vtiger-commits] r4394 - in /vtigercrm/branches/4.2: install.php install/0welcome.php install/1checkSystem.php install/2setConfig.php install/3confirmConfig.php install/4createConfigFile.php install/5createTables.php install/populateSeedData.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Wed Mar 22 21:44:05 EST 2006


Author: mfedyk
Date: Wed Mar 22 19:44:02 2006
New Revision: 4394

Log:
disable installer after successful install for security reasons.  closes #25

Modified:
    vtigercrm/branches/4.2/install.php
    vtigercrm/branches/4.2/install/0welcome.php
    vtigercrm/branches/4.2/install/1checkSystem.php
    vtigercrm/branches/4.2/install/2setConfig.php
    vtigercrm/branches/4.2/install/3confirmConfig.php
    vtigercrm/branches/4.2/install/4createConfigFile.php
    vtigercrm/branches/4.2/install/5createTables.php
    vtigercrm/branches/4.2/install/populateSeedData.php

Modified: vtigercrm/branches/4.2/install.php
==============================================================================
--- vtigercrm/branches/4.2/install.php (original)
+++ vtigercrm/branches/4.2/install.php Wed Mar 22 19:44:02 2006
@@ -16,6 +16,14 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install.php,v 1.2 2004/10/06 09:02:02 jack Exp $
  * Description:  Starts the installation process.
  ********************************************************************************/
+
+if (is_file('config.php')) {
+	require_once('config.php');
+	if (isset($dbconfig['db_hostname']) & is_file('install_lock')) {
+    	header("Location: index.php");
+    	exit();
+    }
+}
 
 if (substr(phpversion(), 0, 1) == "5") {
   ini_set("zend.ze1_compatibility_mode", "1");

Modified: vtigercrm/branches/4.2/install/0welcome.php
==============================================================================
--- vtigercrm/branches/4.2/install/0welcome.php (original)
+++ vtigercrm/branches/4.2/install/0welcome.php Wed Mar 22 19:44:02 2006
@@ -16,6 +16,11 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/0welcome.php,v 1.10 2004/08/26 11:44:30 sarajkumar Exp $
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
+
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
 
 //get php configuration settings. requires elaborate parsing of phpinfo() output
 ob_start();

Modified: vtigercrm/branches/4.2/install/1checkSystem.php
==============================================================================
--- vtigercrm/branches/4.2/install/1checkSystem.php (original)
+++ vtigercrm/branches/4.2/install/1checkSystem.php Wed Mar 22 19:44:02 2006
@@ -16,6 +16,11 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/1checkSystem.php,v 1.16 2005/03/08 12:01:36 samk Exp $
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
+
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
 
 //get php configuration settings.  requires elaborate parsing of phpinfo() output
 ob_start();

Modified: vtigercrm/branches/4.2/install/2setConfig.php
==============================================================================
--- vtigercrm/branches/4.2/install/2setConfig.php (original)
+++ vtigercrm/branches/4.2/install/2setConfig.php Wed Mar 22 19:44:02 2006
@@ -16,6 +16,11 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/2setConfig.php,v 1.41 2005/04/29 06:44:13 samk Exp $
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
+
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
 
 // TODO: deprecate connection.php file
 //require_once("connection.php");

Modified: vtigercrm/branches/4.2/install/3confirmConfig.php
==============================================================================
--- vtigercrm/branches/4.2/install/3confirmConfig.php (original)
+++ vtigercrm/branches/4.2/install/3confirmConfig.php Wed Mar 22 19:44:02 2006
@@ -16,6 +16,11 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/3confirmConfig.php,v 1.14 2005/04/25 09:41:26 samk Exp $
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
+
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
 
 if (isset($_REQUEST['db_hostname']))
 	$db_hostname = $_REQUEST['db_hostname'];

Modified: vtigercrm/branches/4.2/install/4createConfigFile.php
==============================================================================
--- vtigercrm/branches/4.2/install/4createConfigFile.php (original)
+++ vtigercrm/branches/4.2/install/4createConfigFile.php Wed Mar 22 19:44:02 2006
@@ -18,6 +18,11 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/4createConfigFile.php,v 1.26 2005/04/25 05:40:50 samk Exp $
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
+
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
 
 require_once('include/utils.php');
 include('vtigerversion.php');

Modified: vtigercrm/branches/4.2/install/5createTables.php
==============================================================================
--- vtigercrm/branches/4.2/install/5createTables.php (original)
+++ vtigercrm/branches/4.2/install/5createTables.php Wed Mar 22 19:44:02 2006
@@ -17,6 +17,11 @@
  * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/install/5createTables.php,v 1.58 2005/04/19 16:57:08 ray Exp $
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
+
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
 
 set_time_limit(600);
 
@@ -81,6 +86,23 @@
 
 require_once('install/5createTables.inc.php');
 
+if (is_file('install_lock'))
+	$is_writable = is_writable('install_lock');
+else
+	$is_writable = is_writable('.');
+	
+$config_lock = "/*\n\nInstallation Lock File\n\n";
+$config_lock .= "This File is Used to Prevent\n";
+$config_lock .= "Changes to An Existing Configuration\n";
+$config_lock .= "of vtiger.\n\n";
+$config_lock .= "To re-enable the installation mode,\n";
+$config_lock .= "delete this file, and use the\n";
+$config_lock .= "install.php file to restart the configuration.\n\n*/"; 
+
+if ($is_writable && ($install_lock_file = @ fopen("install_lock", "w"))) {
+	fputs($install_lock_file, $config_lock, strlen($config_lock));
+	fclose($install_lock_file);
+}
 ?>
 <HR></HR>
 total time: <?php echo "$deltaTime"; ?> seconds.<BR />

Modified: vtigercrm/branches/4.2/install/populateSeedData.php
==============================================================================
--- vtigercrm/branches/4.2/install/populateSeedData.php (original)
+++ vtigercrm/branches/4.2/install/populateSeedData.php Wed Mar 22 19:44:02 2006
@@ -17,6 +17,11 @@
  * Description:  Executes a step in the installation process.
  ********************************************************************************/
 
+if (is_file('../install_lock')) {
+    header("Location: ../index.php");
+    exit();
+}
+
 require_once('config.php');
 
 require_once('modules/Leads/Lead.php');





More information about the vtigercrm-commits mailing list