From a075959f73f23d4bb93382d6b941baf487fff9fb Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 06 Dec 2012 10:27:46 -0500
Subject: [PATCH] Fixed: FS#2570 - Changind site domain rewrites custom open_basedir settings - Added check that aps plugin installs package only once on a mirrored system - Added "IPCCommTimeout  7200" in ispconfig apache vhost.

---
 server/plugins-available/aps_plugin.inc.php |    4 ++++
 install/tpl/apache_ispconfig.vhost.master   |    1 +
 interface/web/sites/web_domain_edit.php     |    8 +++++++-
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/install/tpl/apache_ispconfig.vhost.master b/install/tpl/apache_ispconfig.vhost.master
index 4d59dfe..e00f293 100644
--- a/install/tpl/apache_ispconfig.vhost.master
+++ b/install/tpl/apache_ispconfig.vhost.master
@@ -25,6 +25,7 @@
       Order allow,deny
       Allow from all
     </Directory>
+    IPCCommTimeout  7200
   </IfModule>
   
 #  <IfModule mod_php5.c>
diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php
index 758c05f..5cc7f5e 100644
--- a/interface/web/sites/web_domain_edit.php
+++ b/interface/web/sites/web_domain_edit.php
@@ -853,7 +853,13 @@
 		
 		//* Set php_open_basedir if empty or domain or client has been changed
 		if(empty($web_rec['php_open_basedir']) ||
-		(!empty($this->dataRecord["domain"]) && !empty($this->oldDataRecord["domain"]) && $this->dataRecord["domain"] != $this->oldDataRecord["domain"]) ||
+		(!empty($this->dataRecord["domain"]) && !empty($this->oldDataRecord["domain"]) && $this->dataRecord["domain"] != $this->oldDataRecord["domain"])) {
+			$php_open_basedir = $web_rec['php_open_basedir'];
+			$php_open_basedir = str_replace($this->oldDataRecord['domain'],$web_rec['domain'],$php_open_basedir);
+			$sql = "UPDATE web_domain SET php_open_basedir = '$php_open_basedir' WHERE domain_id = ".$this->id;
+			$app->db->query($sql);
+		}
+		if(empty($web_rec['php_open_basedir']) ||
 		(isset($this->dataRecord["client_group_id"]) && $this->dataRecord["client_group_id"] != $this->oldDataRecord["sys_groupid"])) {
 			$document_root = $app->db->quote(str_replace("[client_id]",$client_id,$document_root));
 			$php_open_basedir = str_replace("[website_path]",$document_root,$web_config["php_open_basedir"]);
diff --git a/server/plugins-available/aps_plugin.inc.php b/server/plugins-available/aps_plugin.inc.php
index ddeca3d..dbbbfb9 100644
--- a/server/plugins-available/aps_plugin.inc.php
+++ b/server/plugins-available/aps_plugin.inc.php
@@ -69,6 +69,10 @@
     {
         global $app, $conf;
         
+		//* dont run the installer on a mirror server to prevent
+		//  that the pplication gets installed twice.
+		if($conf['mirror_server_id'] > 0) return true;
+		
 		$app->log("Starting APS install",LOGLEVEL_DEBUG);
         if(!isset($data['new']['id'])) return false;
         $instanceid = $data['new']['id'];

--
Gitblit v1.9.1