From e5316b8a93bdc1f9bab0604a9558d2bff5e9f58f Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Thu, 25 Oct 2012 09:25:36 -0400
Subject: [PATCH] Fixed: APS Installing now works in vhost subdomains Fixed: domain select box of aps installer is now in place Updated: some debug log messages should be warnings

---
 server/lib/classes/aps_installer.inc.php |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/server/lib/classes/aps_installer.inc.php b/server/lib/classes/aps_installer.inc.php
index de1500c..94d5ee0 100644
--- a/server/lib/classes/aps_installer.inc.php
+++ b/server/lib/classes/aps_installer.inc.php
@@ -77,7 +77,7 @@
         }
         catch(Exception $e)
         {
-            $app->log('Aborting execution because '.$e->getMessage());
+            $app->log('Aborting execution because '.$e->getMessage(), 1);
             return false;
         }
     }
@@ -252,7 +252,7 @@
         $this->domain = $main_domain['value'];
         
         // Get the document root
-        $domain_res = $app->db->queryOneRecord("SELECT document_root FROM web_domain 
+        $domain_res = $app->db->queryOneRecord("SELECT document_root, web_folder, type FROM web_domain 
             WHERE domain = '".$app->db->quote($this->domain)."';");
         $this->document_root = $domain_res['document_root'];
         
@@ -265,7 +265,8 @@
         if(substr($this->document_root, -1) != '/') $this->document_root .= '/';
         
         // Attention: ISPConfig Special: web files are in subfolder 'web' -> append it:
-        $this->document_root .= 'web/';
+        if($domain_res['type'] == 'vhostsubdomain') $this->document_root .= $domain_res['web_folder'] . '/';
+        else $this->document_root .= 'web/';
 
         // If a subfolder is given, make sure it's path doesn't begin with / i.e. /phpbb
         if(substr($this->sublocation, 0, 1) == '/') $this->sublocation = substr($this->sublocation, 1);
@@ -429,7 +430,7 @@
         {
             $app->dbmaster->query('UPDATE aps_instances SET instance_status = "'.INSTANCE_ERROR.'" 
                 WHERE id = "'.$app->db->quote($task['instance_id']).'";');
-            $app->log($e->getMessage());
+            $app->log($e->getMessage(), 1);
             return false;
         }
         
@@ -565,7 +566,7 @@
         {
             $app->dbmaster->query('UPDATE aps_instances SET instance_status = "'.INSTANCE_ERROR.'" 
                 WHERE id = "'.$app->db->quote($task['instance_id']).'";');
-            $app->log($e->getMessage());
+            $app->log($e->getMessage(), 1);
             return false;
         }
         
@@ -622,7 +623,7 @@
 			curl_setopt($ch, CURLOPT_TIMEOUT, 0);
 			curl_setopt($ch, CURLOPT_FAILONERROR, 1);
 			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);     
-			if(curl_exec($ch) === false) $app->log(curl_error ($ch),LOGLEVEL_DEBUG);
+			if(curl_exec($ch) === false) $app->log(curl_error ($ch),1);
 			fclose($fh);
 			curl_close($ch);
 		}
@@ -646,7 +647,7 @@
         {
             $app->dbmaster->query('UPDATE aps_instances SET instance_status = "'.INSTANCE_ERROR.'" 
                 WHERE id = "'.$app->db->quote($task['instance_id']).'";');
-            $app->log('Unable to find the meta data file of package '.$task['path']);
+            $app->log('Unable to find the meta data file of package '.$task['path'], 1);
             return false;
         }
         

--
Gitblit v1.9.1