From d5be8964ba83473bd5433ea79341b620d0254db6 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 18 Aug 2008 12:09:56 -0400
Subject: [PATCH] Fixed a bug were index.html gets overwriten when a subdomain is added.

---
 install/lib/installer_base.lib.php |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php
index c28947a..db98d1f 100644
--- a/install/lib/installer_base.lib.php
+++ b/install/lib/installer_base.lib.php
@@ -115,6 +115,7 @@
 	public function configure_database()
     {
 		global $conf;
+		
 		$cf = $conf['mysql']; // make $conf['mysql'] more accessible
 		//** Create the database
 		if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'])) {
@@ -147,6 +148,7 @@
 	public function add_database_server_record() {
 		
 		global $conf;
+		
 		$cf = $conf['mysql']; // make $conf['mysql'] more accessible
 		
 		if($cf['host'] == 'localhost') {
@@ -181,7 +183,9 @@
 
     //** writes postfix configuration files
     private function process_postfix_config($configfile)
-    {
+    {	
+		global $conf;
+		
         $config_dir = $conf['postfix']['config_dir'].'/';
         $full_file_name = $config_dir.$configfile; 
         //* Backup exiting file
@@ -199,7 +203,9 @@
 
 	public function configure_jailkit()
     {
-        $cf = $conf['jailkit'];
+        global $conf;
+		
+		$cf = $conf['jailkit'];
 		$config_dir = $cf['config_dir'];
 		$jk_init = $cf['jk_init'];
 		$jk_chrootsh = $cf['jk_chrootsh'];
@@ -504,7 +510,7 @@
 		if(is_file($conf["postfix"]["config_dir"].'/master.cf')) copy($conf["postfix"]["config_dir"].'/master.cf',$conf["postfix"]["config_dir"].'/master.cf~');
 		$content = rf("tpl/master_cf_amavis.master");
 		// Only add the content if we had not addded it before
-		if(!stristr("127.0.0.1:10025 inet n - - - - smtpd",$content)) {
+		if(!stristr($content,"127.0.0.1:10025")) {
 			af($conf["postfix"]["config_dir"].'/master.cf',$content);
 		}
 		
@@ -530,6 +536,8 @@
 	
 	public function configure_getmail()
     {
+		global $conf;
+		
 		$config_dir = $conf['getmail']['config_dir'];
 		
 		if(!is_dir($config_dir)) exec("mkdir -p ".escapeshellcmd($config_dir));
@@ -595,6 +603,8 @@
 	
 	public function configure_apache()
     {	
+		global $conf;
+		
 		//* Create the logging directory for the vhost logfiles
 		exec('mkdir -p /var/log/ispconfig/httpd');
 		
@@ -606,6 +616,7 @@
 		
 		$dist_init_scripts = $conf['init_scripts'];
   		
+		if(is_dir("/etc/Bastille.backup")) caselog("rm -rf /etc/Bastille.backup", __FILE__, __LINE__);
 		if(is_dir("/etc/Bastille")) caselog("mv -f /etc/Bastille /etc/Bastille.backup", __FILE__, __LINE__);
   		@mkdir("/etc/Bastille", octdec($directory_mode));
   		if(is_dir("/etc/Bastille.backup/firewall.d")) caselog("cp -pfr /etc/Bastille.backup/firewall.d /etc/Bastille/", __FILE__, __LINE__);

--
Gitblit v1.9.1