From 341ef7175af7c8f21d27262b58da8f5bc2c06ef0 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 08 Jul 2014 08:44:59 -0400
Subject: [PATCH] Merge branch 'master_fixes' into 'master'

---
 interface/lib/classes/quota_lib.inc.php |   14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/interface/lib/classes/quota_lib.inc.php b/interface/lib/classes/quota_lib.inc.php
index 7446573..b9ef6aa 100644
--- a/interface/lib/classes/quota_lib.inc.php
+++ b/interface/lib/classes/quota_lib.inc.php
@@ -14,12 +14,7 @@
 		//print_r($monitor_data);
 		
 		// select all websites or websites belonging to client
-		if($clientid != null){
-			$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost' AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)", $app->functions->intval($client_id));
-		}
-		else {
-			$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'");
-		}
+		$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".(($clientid != null)?" AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)":''), $app->functions->intval($client_id));
 		
 		//print_r($sites);
 		if(is_array($sites) && !empty($sites)){
@@ -114,12 +109,7 @@
 		//print_r($monitor_data);
 		
 		// select all email accounts or email accounts belonging to client
-		if($clientid != null){
-			$emails = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)", $app->functions->intval($client_id));
-		}
-		else {
-			$emails = $app->db->queryAllRecords("SELECT * FROM mail_user");
-		}
+		$emails = $app->db->queryAllRecords("SELECT * FROM mail_user".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : ''), $app->functions->intval($client_id));
 		
 		//print_r($emails);
 		if(is_array($emails) && !empty($emails)){

--
Gitblit v1.9.1