Skip to content

Commit b454796

Browse files
committed
switched to new query syntax - do quoting where it is needed
1 parent f1c4cdd commit b454796

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

interface/lib/classes/quota_lib.inc.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ public function get_quota_data($clientid = null, $readable = true) {
1313
}
1414
//print_r($monitor_data);
1515

16+
// select all websites or websites belonging to client
1617
if($clientid != null){
17-
$sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")";
18+
$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost' AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)", $app->functions->intval($client_id));
19+
}
20+
else {
21+
$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'");
1822
}
1923

20-
// select websites belonging to client
21-
$sites = $app->db->queryAllRecords("SELECT * FROM web_domain WHERE active = 'y' AND type = 'vhost'".$sql_where);
2224
//print_r($sites);
2325
if(is_array($sites) && !empty($sites)){
2426
for($i=0;$i<sizeof($sites);$i++){
@@ -111,13 +113,14 @@ public function get_mailquota_data($clientid = null, $readable = true) {
111113
}
112114
//print_r($monitor_data);
113115

116+
// select all email accounts or email accounts belonging to client
114117
if($clientid != null){
115-
$sql_where = " AND sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=".$clientid.")";
118+
$emails = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE sys_groupid = (SELECT default_group FROM sys_user WHERE client_id=?)", $app->functions->intval($client_id));
119+
}
120+
else {
121+
$emails = $app->db->queryAllRecords("SELECT * FROM mail_user");
116122
}
117123

118-
119-
// select email accounts belonging to client
120-
$emails = $app->db->queryAllRecords("SELECT * FROM mail_user WHERE 1".$sql_where);
121124
//print_r($emails);
122125
if(is_array($emails) && !empty($emails)){
123126
for($i=0;$i<sizeof($emails);$i++){

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,6 @@ public function mailquota_get_by_user($session_id, $client_id)
10341034
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
10351035
return false;
10361036
}
1037-
$client_id = $app->functions->intval($client_id);
10381037

10391038
return $app->quota_lib->get_mailquota_data($client_id, false);
10401039
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,6 @@ public function quota_get_by_user($session_id, $client_id)
882882
$this->server->fault('permission_denied', 'You do not have the permissions to access this function.');
883883
return false;
884884
}
885-
$client_id = $app->functions->intval($client_id);
886885

887886
return $app->quota_lib->get_quota_data($client_id, false);
888887
}

0 commit comments

Comments
 (0)