From f1c4cdd6a7c963d7357a7ea30e7413f2dbdd4ccc Mon Sep 17 00:00:00 2001
From: Dominik Mueller <info@profi-webdesign.net>
Date: Wed, 05 Mar 2014 09:14:38 -0500
Subject: [PATCH] Changed Quota-Functions from sys_group to client_id

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

diff --git a/interface/lib/classes/quota_lib.inc.php b/interface/lib/classes/quota_lib.inc.php
index c5a442e..55b2aa8 100644
--- a/interface/lib/classes/quota_lib.inc.php
+++ b/interface/lib/classes/quota_lib.inc.php
@@ -1,7 +1,7 @@
 <?php
 
 class quota_lib {
-	public function get_quota_data($groupid = null, $readable = true) {
+	public function get_quota_data($clientid = null, $readable = true) {
 		global $app; 
 		
 		$tmp_rec =  $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
@@ -13,8 +13,8 @@
 		}
 		//print_r($monitor_data);
 		
-		if($groupid != null){
-			$sql_where = " AND sys_groupid = ".$groupid;
+		if($clientid != null){
+			$sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")";
 		}
 		
 		// select websites belonging to client
@@ -93,7 +93,7 @@
 		return $sites;
 	}
 
-	public function get_mailquota_data($groupid = null, $readable = true) {
+	public function get_mailquota_data($clientid = null, $readable = true) {
 		global $app;
 		
 		$tmp_rec =  $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'email_quota' ORDER BY created DESC");
@@ -111,8 +111,8 @@
 		}
 		//print_r($monitor_data);
 		
-		if($groupid != null){
-			$sql_where = " AND sys_groupid = ".$groupid;
+		if($clientid != null){
+			$sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")";
 		}
 		
 		

--
Gitblit v1.9.1