| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | // Check if the user may add another website. |
| | | if($client["limit_client"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_client"]) { |
| | | $app->error($app->tform->wordbook["limit_client_txt"]); |
| | | } |
| | |
| | | |
| | | // Get the limits of the client |
| | | $client_group_id = $_SESSION["s"]["user"]["default_group"]; |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); |
| | | $client = $app->db->queryOneRecord("SELECT limit_client FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id); |
| | | |
| | | // Check if the user may add another website. |
| | | if($client["limit_client"] >= 0) { |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = $client_group_id"); |
| | | $tmp = $app->db->queryOneRecord("SELECT count(client_id) as number FROM client WHERE sys_groupid = ?", $client_group_id); |
| | | if($tmp["number"] >= $client["limit_client"]) { |
| | | $app->error($app->tform->wordbook["limit_client_txt"]); |
| | | } |
| | |
| | | $this->dataRecord['limit_client'] = 0; |
| | | } else { |
| | | if($this->dataRecord["reseller"]) { |
| | | $this->dataRecord["limit_client"] = 1; |
| | | $this->dataRecord["limit_client"] = 1; // allow 1 client, template limits will be applied later, if we set -1 it would override template limits |
| | | } |
| | | } |
| | | |