Skip to content

Commit f1c4cdd

Browse files
committed
Changed Quota-Functions from sys_group to client_id
1 parent c7e2316 commit f1c4cdd

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

interface/lib/classes/quota_lib.inc.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
class quota_lib {
4-
public function get_quota_data($groupid = null, $readable = true) {
4+
public function get_quota_data($clientid = null, $readable = true) {
55
global $app;
66

77
$tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'harddisk_quota' ORDER BY created DESC");
@@ -13,8 +13,8 @@ public function get_quota_data($groupid = null, $readable = true) {
1313
}
1414
//print_r($monitor_data);
1515

16-
if($groupid != null){
17-
$sql_where = " AND sys_groupid = ".$groupid;
16+
if($clientid != null){
17+
$sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")";
1818
}
1919

2020
// select websites belonging to client
@@ -93,7 +93,7 @@ public function get_quota_data($groupid = null, $readable = true) {
9393
return $sites;
9494
}
9595

96-
public function get_mailquota_data($groupid = null, $readable = true) {
96+
public function get_mailquota_data($clientid = null, $readable = true) {
9797
global $app;
9898

9999
$tmp_rec = $app->db->queryAllRecords("SELECT data from monitor_data WHERE type = 'email_quota' ORDER BY created DESC");
@@ -111,8 +111,8 @@ public function get_mailquota_data($groupid = null, $readable = true) {
111111
}
112112
//print_r($monitor_data);
113113

114-
if($groupid != null){
115-
$sql_where = " AND sys_groupid = ".$groupid;
114+
if($clientid != null){
115+
$sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")";
116116
}
117117

118118

interface/lib/classes/remote.d/mail.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ public function mail_domain_set_status($session_id, $primary_id, $status) {
10251025
}
10261026

10271027
//** quota functions -----------------------------------------------------------------------------------
1028-
public function mailquota_get_by_user($session_id, $group_id)
1028+
public function mailquota_get_by_user($session_id, $client_id)
10291029
{
10301030
global $app;
10311031
$app->uses('quota_lib');
@@ -1034,9 +1034,9 @@ public function mailquota_get_by_user($session_id, $group_id)
10341034
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
10351035
return false;
10361036
}
1037-
$group_id = $app->functions->intval($group_id);
1037+
$client_id = $app->functions->intval($client_id);
10381038

1039-
return $app->quota_lib->get_mailquota_data($group_id, false);
1039+
return $app->quota_lib->get_mailquota_data($client_id, false);
10401040
}
10411041

10421042
}

interface/lib/classes/remote.d/sites.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ public function sites_database_get_all_by_user($session_id, $client_id)
873873
}
874874

875875
//** quota functions -----------------------------------------------------------------------------------
876-
public function quota_get_by_user($session_id, $group_id)
876+
public function quota_get_by_user($session_id, $client_id)
877877
{
878878
global $app;
879879
$app->uses('quota_lib');
@@ -882,9 +882,9 @@ public function quota_get_by_user($session_id, $group_id)
882882
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
883883
return false;
884884
}
885-
$group_id = $app->functions->intval($group_id);
885+
$client_id = $app->functions->intval($client_id);
886886

887-
return $app->quota_lib->get_quota_data($group_id, false);
887+
return $app->quota_lib->get_quota_data($client_id, false);
888888
}
889889

890890

interface/web/dashboard/dashlets/mailquota.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function show() {
1616
if(is_file($lng_file)) include $lng_file;
1717
$tpl->setVar($wb);
1818

19-
$emails = $app->quota_lib->get_mailquota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['default_group'] : null);
19+
$emails = $app->quota_lib->get_mailquota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
2020
//print_r($emails);
2121

2222
$has_mailquota = false;

interface/web/dashboard/dashlets/quota.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function show() {
1616
if(is_file($lng_file)) include $lng_file;
1717
$tpl->setVar($wb);
1818

19-
$sites = $app->quota_lib->get_quota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['default_group'] : null);
19+
$sites = $app->quota_lib->get_quota_data( ($_SESSION["s"]["user"]["typ"] != 'admin') ? $_SESSION['s']['user']['client_id'] : null);
2020
//print_r($sites);
2121

2222
$has_quota = false;

0 commit comments

Comments
 (0)