You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Normalize a path and strip duplicate slashes from it
@@ -652,6 +674,22 @@ public function func_client_cancel($client_id,$cancel) {
652
674
return$result;
653
675
}
654
676
677
+
/**
678
+
* Lookup a client's group + all groups he is reselling.
679
+
*
680
+
* @return string Comma separated list of groupid's
681
+
*/
682
+
functionclientid_to_groups_list($client_id) {
683
+
global$app;
684
+
685
+
if ($client_id != null) {
686
+
// Get the clients groupid, and incase it's a reseller the groupid's of it's clients.
687
+
$group = $app->db->queryOneRecord("SELECT GROUP_CONCAT(groupid) AS groups FROM `sys_group` WHERE client_id IN (SELECT client_id FROM `client` WHERE client_id=? OR parent_client_id=?)", $client_id, $client_id);
Copy file name to clipboardExpand all lines: interface/lib/classes/quota_lib.inc.php
+22-60Lines changed: 22 additions & 60 deletions
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,10 @@ public function get_quota_data($clientid = null, $readable = true) {
14
14
//print_r($monitor_data);
15
15
16
16
// select all websites or websites belonging to client
17
-
$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=?)":'') . " ORDER BY domain", $clientid);
17
+
$q = "SELECT * FROM web_domain WHERE type = 'vhost' AND ";
@@ -245,7 +220,10 @@ public function get_mailquota_data($clientid = null, $readable = true, $email =
245
220
246
221
}
247
222
// select all email accounts or email accounts belonging to client
248
-
$emails = $app->db->queryAllRecords("SELECT * FROM mail_user".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : '') . " ORDER BY email", $clientid);
@@ -317,18 +286,21 @@ public function get_databasequota_data($clientid = null, $readable = true) {
317
286
//print_r($monitor_data);
318
287
319
288
// select all databases belonging to client
320
-
$databases = $app->db->queryAllRecords("SELECT * FROM web_database".(($clientid != null)? " WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)" : '') . " ORDER BY database_name", $clientid);
0 commit comments