From fac721841ec470d7c1269ec62eb094e101b75e29 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Wed, 27 Feb 2013 05:32:29 -0500
Subject: [PATCH] Fixed: FS#2727 - APS installations / deletions alters permissions

---
 server/lib/classes/aps_installer.inc.php |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/server/lib/classes/aps_installer.inc.php b/server/lib/classes/aps_installer.inc.php
index 5951698..6cb922f 100644
--- a/server/lib/classes/aps_installer.inc.php
+++ b/server/lib/classes/aps_installer.inc.php
@@ -445,6 +445,11 @@
                 $this->file_owner_user = $owner_res['system_user']; 
                 $this->file_owner_group = $owner_res['system_group'];
                 exec('chown -R '.$this->file_owner_user.':'.$this->file_owner_group.' '.escapeshellarg($this->local_installpath));
+				
+				//* Chown stats directory back
+				if(is_dir($this->local_installpath.'stats')) {
+					exec('chown -R root:root '.escapeshellarg($this->local_installpath.'stats'));
+				}
             }
         }
         catch(Exception $e)
@@ -578,6 +583,11 @@
             {
                 // The install succeeded, chown newly created files too
                 exec('chown -R '.$this->file_owner_user.':'.$this->file_owner_group.' '.escapeshellarg($this->local_installpath));
+				
+				//* Chown stats directory back
+				if(is_dir($this->local_installpath.'stats')) {
+					exec('chown -R root:root '.escapeshellarg($this->local_installpath.'stats'));
+				}
                 
                 $app->dbmaster->query('UPDATE aps_instances SET instance_status = "'.INSTANCE_SUCCESS.'" 
                     WHERE id = "'.$app->db->quote($task['instance_id']).'";');

--
Gitblit v1.9.1