Skip to content

Commit dcd2c0e

Browse files
committed
include every domain from client's reseller when checking reseller quota
1 parent 80e18c2 commit dcd2c0e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,8 @@ function onSubmit() {
835835
if($this->_vhostdomain_type == 'domain') {
836836
//* Check the website quota of the client
837837
if(isset($_POST["hd_quota"]) && $reseller["limit_web_quota"] >= 0 && $_POST["hd_quota"] != $old_web_values["hd_quota"]) {
838-
$tmp = $app->db->queryOneRecord("SELECT sum(hd_quota) as webquota FROM web_domain WHERE domain_id != ".$app->functions->intval($this->id)." AND type = 'vhost' AND ".$app->tform->getAuthSQL('u'));
838+
$tmp = $app->db->queryOneRecord("SELECT sum(hd_quota) as webquota FROM web_domain, sys_group, client WHERE web_domain.sys_groupid=sys_group.groupid AND sys_group.client_id=client.client_id AND ".$client['parent_client_id']." IN (client.parent_client_id, client.client_id) AND domain_id != ".$app->functions->intval($this->id)." AND type = 'vhost'");
839+
839840
$webquota = $tmp["webquota"];
840841
$new_web_quota = $app->functions->intval($this->dataRecord["hd_quota"]);
841842
if(($webquota + $new_web_quota > $reseller["limit_web_quota"]) || ($new_web_quota < 0 && $reseller["limit_web_quota"] >= 0)) {
@@ -852,7 +853,7 @@ function onSubmit() {
852853

853854
//* Check the traffic quota of the client
854855
if(isset($_POST["traffic_quota"]) && $reseller["limit_traffic_quota"] > 0 && $_POST["traffic_quota"] != $old_web_values["traffic_quota"]) {
855-
$tmp = $app->db->queryOneRecord("SELECT sum(traffic_quota) as trafficquota FROM web_domain WHERE domain_id != ".$app->functions->intval($this->id)." AND ".$app->tform->getAuthSQL('u'));
856+
$tmp = $app->db->queryOneRecord("SELECT sum(traffic_quota) as trafficquota FROM web_domain, sys_group, client WHERE web_domain.sys_groupid=sys_group.groupid AND sys_group.client_id=client.client_id AND ".$client['parent_client_id']." IN (client.parent_client_id, client.client_id) AND domain_id != ".$app->functions->intval($this->id)." AND type = 'vhost'");
856857
$trafficquota = $tmp["trafficquota"];
857858
$new_traffic_quota = $app->functions->intval($this->dataRecord["traffic_quota"]);
858859
if(($trafficquota + $new_traffic_quota > $reseller["limit_traffic_quota"]) || ($new_traffic_quota < 0 && $reseller["limit_traffic_quota"] >= 0)) {

0 commit comments

Comments
 (0)