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

---
 interface/web/themes/default/css/styles.css |    3 ++-
 server/lib/classes/aps_installer.inc.php    |   15 ++++++++-------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/interface/web/themes/default/css/styles.css b/interface/web/themes/default/css/styles.css
index 390de7e..ad13d7d 100644
--- a/interface/web/themes/default/css/styles.css
+++ b/interface/web/themes/default/css/styles.css
@@ -1784,4 +1784,5 @@
 ul.ui-autocomplete { max-height: 250px; overflow-y: auto; min-width: 50px;}
 .ui-combobox { position: relative; display: inline-block; margin-right: 17px; }
 .ui-combobox-toggle { position: absolute !important; top: 0; bottom: 0; margin-left: -1px; padding: 1px !important; background: none repeat scroll 0 0 #FFFFFF !important; border: 1px solid #DFDFDF !important;}
-.ui-combobox-input { background: none repeat scroll 0 0 #FFFFFF !important; border: 1px solid #DFDFDF !important; padding: 1px; font-weight: normal !important; }
\ No newline at end of file
+.ui-combobox-input { background: none repeat scroll 0 0 #FFFFFF !important; border: 1px solid #DFDFDF !important; padding: 1px; font-weight: normal !important; }
+.panel_install_package .ui-combobox { float: left; }
\ No newline at end of file
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