From 41d7d170bc4673e9a4e89a49c191b414e38ef0d7 Mon Sep 17 00:00:00 2001
From: Sergio Cambra <sergio@programatica.es>
Date: Tue, 08 Jul 2014 08:00:01 -0400
Subject: [PATCH] default servers on system config for admin use
---
interface/lib/classes/quota_lib.inc.php | 19 ++++++-------------
1 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/interface/lib/classes/quota_lib.inc.php b/interface/lib/classes/quota_lib.inc.php
index c5a442e..b9ef6aa 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,12 +13,9 @@
}
//print_r($monitor_data);
- if($groupid != null){
- $sql_where = " AND sys_groupid = ".$groupid;
- }
+ // select all websites or websites belonging to client
+ $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));
- // select websites belonging to client
- $sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".$sql_where);
//print_r($sites);
if(is_array($sites) && !empty($sites)){
for($i=0;$i<sizeof($sites);$i++){
@@ -93,7 +90,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,13 +108,9 @@
}
//print_r($monitor_data);
- if($groupid != null){
- $sql_where = " AND sys_groupid = ".$groupid;
- }
+ // select all email accounts or email accounts belonging to client
+ $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));
-
- // select email accounts belonging to client
- $emails = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE 1".$sql_where);
//print_r($emails);
if(is_array($emails) && !empty($emails)){
for($i=0;$i<sizeof($emails);$i++){
--
Gitblit v1.9.1