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/remote.d/sites.inc.php | 6 +++---
interface/web/dashboard/dashlets/quota.php | 2 +-
interface/web/dashboard/dashlets/mailquota.php | 2 +-
interface/lib/classes/quota_lib.inc.php | 12 ++++++------
interface/lib/classes/remote.d/mail.inc.php | 6 +++---
5 files changed, 14 insertions(+), 14 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.")";
}
diff --git a/interface/lib/classes/remote.d/mail.inc.php b/interface/lib/classes/remote.d/mail.inc.php
index ef37c61..d97f575 100644
--- a/interface/lib/classes/remote.d/mail.inc.php
+++ b/interface/lib/classes/remote.d/mail.inc.php
@@ -1025,7 +1025,7 @@
}
//** quota functions -----------------------------------------------------------------------------------
- public function mailquota_get_by_user($session_id, $group_id)
+ public function mailquota_get_by_user($session_id, $client_id)
{
global $app;
$app->uses('quota_lib');
@@ -1034,9 +1034,9 @@
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
- $group_id = $app->functions->intval($group_id);
+ $client_id = $app->functions->intval($client_id);
- return $app->quota_lib->get_mailquota_data($group_id, false);
+ return $app->quota_lib->get_mailquota_data($client_id, false);
}
}
diff --git a/interface/lib/classes/remote.d/sites.inc.php b/interface/lib/classes/remote.d/sites.inc.php
index 704a87e..91b4523 100644
--- a/interface/lib/classes/remote.d/sites.inc.php
+++ b/interface/lib/classes/remote.d/sites.inc.php
@@ -873,7 +873,7 @@
}
//** quota functions -----------------------------------------------------------------------------------
- public function quota_get_by_user($session_id, $group_id)
+ public function quota_get_by_user($session_id, $client_id)
{
global $app;
$app->uses('quota_lib');
@@ -882,9 +882,9 @@
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
return false;
}
- $group_id = $app->functions->intval($group_id);
+ $client_id = $app->functions->intval($client_id);
- return $app->quota_lib->get_quota_data($group_id, false);
+ return $app->quota_lib->get_quota_data($client_id, false);
}
diff --git a/interface/web/dashboard/dashlets/mailquota.php b/interface/web/dashboard/dashlets/mailquota.php
index e0f6be2..27b8333 100644
--- a/interface/web/dashboard/dashlets/mailquota.php
+++ b/interface/web/dashboard/dashlets/mailquota.php
@@ -16,7 +16,7 @@
if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb);
- $emails = $app->quota_lib->get_mailquota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['default_group'] : null);
+ $emails = $app->quota_lib->get_mailquota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
//print_r($emails);
$has_mailquota = false;
diff --git a/interface/web/dashboard/dashlets/quota.php b/interface/web/dashboard/dashlets/quota.php
index 589de71..a72e1fd 100644
--- a/interface/web/dashboard/dashlets/quota.php
+++ b/interface/web/dashboard/dashlets/quota.php
@@ -16,7 +16,7 @@
if(is_file($lng_file)) include $lng_file;
$tpl->setVar($wb);
- $sites = $app->quota_lib->get_quota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['default_group'] : null);
+ $sites = $app->quota_lib->get_quota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
//print_r($sites);
$has_quota = false;
--
Gitblit v1.9.1