From 41eaa8742ea0004c49d5407b9caa3cf01e836fe3 Mon Sep 17 00:00:00 2001
From: cfoe <cfoe@ispconfig3>
Date: Tue, 21 Aug 2012 04:30:24 -0400
Subject: [PATCH] fixed php errors on install/update

---
 install/dist/lib/fedora.lib.php |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/install/dist/lib/fedora.lib.php b/install/dist/lib/fedora.lib.php
index 4fbd4b5..f4f48c3 100644
--- a/install/dist/lib/fedora.lib.php
+++ b/install/dist/lib/fedora.lib.php
@@ -279,6 +279,9 @@
 		
 		$config_dir = $conf['dovecot']['config_dir'];
 		
+		//* Use /etc/dovecot as config dir if exists
+		if(is_dir('/etc/dovecot')) $config_dir = '/etc/dovecot';
+		
 		//* Configure master.cf and add a line for deliver
 		if(is_file($config_dir.'/master.cf')){
             copy($config_dir.'/master.cf', $config_dir.'/master.cf~2');
@@ -289,7 +292,7 @@
 		$content = rf($conf["postfix"]["config_dir"].'/master.cf');
 		// Only add the content if we had not addded it before
 		if(!stristr($content,"dovecot/deliver")) {
-			$deliver_content = 'dovecot   unix  -       n       n       -       -       pipe'."\n".'  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}';
+			$deliver_content = 'dovecot   unix  -       n       n       -       -       pipe'."\n".'  flags=DROhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${user}@${nexthop}';
 			af($conf["postfix"]["config_dir"].'/master.cf',$deliver_content);
 		}
 		unset($content);
@@ -739,6 +742,7 @@
 		$content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
 		$content = str_replace('{language}', $conf['language'], $content);
 		$content = str_replace('{timezone}', $conf['timezone'], $content);
+		$content = str_replace('{theme}', $conf['theme'], $content);
 		
 		wf("$install_dir/interface/lib/$configfile", $content);
 		
@@ -762,6 +766,7 @@
 		$content = str_replace('{ispconfig_log_priority}', $conf['ispconfig_log_priority'], $content);
 		$content = str_replace('{language}', $conf['language'], $content);
 		$content = str_replace('{timezone}', $conf['timezone'], $content);
+		$content = str_replace('{theme}', $conf['theme'], $content);
 
 		wf("$install_dir/server/lib/$configfile", $content);
 		
@@ -864,6 +869,10 @@
 				}
 			}
 		}
+		
+		//* Make the APS directories group writable
+		exec("chmod -R 770 $install_dir/interface/web/sites/aps_meta_packages");
+		exec("chmod -R 770 $install_dir/server/aps_packages");
 		
 		//* make sure that the server config file (not the interface one) is only readable by the root user
 		exec("chmod 600 $install_dir/server/lib/$configfile");
@@ -1043,9 +1052,8 @@
 		replaceLine('/etc/sudoers','Defaults    requiretty','#Defaults    requiretty',0,0);
 		
 		if(is_dir($install_dir.'/interface/invoices')) {
-			chmod($install_dir.'/interface/invoices', 0770);
-			chown($install_dir.'/interface/invoices', 'ispconfig');
-			chgrp($install_dir.'/interface/invoices', 'ispconfig');
+			exec('chmod -R 770 '.escapeshellarg($install_dir.'/interface/invoices'));
+			exec('chown -R ispconfig:ispconfig '.escapeshellarg($install_dir.'/interface/invoices'));
 		}
 		
 	}
@@ -1066,6 +1074,7 @@
 		}
 		
 		$content = rf("tpl/mysql_clientdb.conf.master");
+		$content = str_replace('{hostname}',$conf['mysql']['host'],$content);
 		$content = str_replace('{username}',$conf['mysql']['admin_user'],$content);
 		$content = str_replace('{password}',$conf['mysql']['admin_password'], $content);
 		wf("$install_dir/server/lib/mysql_clientdb.conf",$content);

--
Gitblit v1.9.1