Commit 8e23f2ed authored by tbrehm's avatar tbrehm
Browse files

Update dns/dns_soa_edit.php

parent ea379616
...@@ -99,26 +99,28 @@ class page_action extends tform_actions { ...@@ -99,26 +99,28 @@ class page_action extends tform_actions {
function onSubmit() { function onSubmit() {
global $app, $conf; global $app, $conf;
// Get the limits of the client if($_SESSION["s"]["user"]["typ"] != 'admin') {
$client_group_id = $_SESSION["s"]["user"]["default_group"]; // Get the limits of the client
$client = $app->db->queryOneRecord("SELECT limit_dns_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id"); $client_group_id = $_SESSION["s"]["user"]["default_group"];
$client = $app->db->queryOneRecord("SELECT limit_dns_zone, default_dnsserver FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = $client_group_id");
// When the record is updated
if($this->id > 0) { // When the record is updated
// restore the server ID if the user is not admin and record is edited if($this->id > 0) {
$tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_soa WHERE id = ".intval($this->id)); // restore the server ID if the user is not admin and record is edited
$this->dataRecord["server_id"] = $tmp["server_id"]; $tmp = $app->db->queryOneRecord("SELECT server_id FROM dns_soa WHERE id = ".intval($this->id));
unset($tmp); $this->dataRecord["server_id"] = $tmp["server_id"];
// When the record is inserted unset($tmp);
} else { // When the record is inserted
// set the server ID to the default mailserver of the client } else {
$this->dataRecord["server_id"] = $client["default_dnsserver"]; // set the server ID to the default mailserver of the client
$this->dataRecord["server_id"] = $client["default_dnsserver"];
// Check if the user may add another maildomain. // Check if the user may add another maildomain.
if($client["limit_dns_zone"] >= 0) { if($client["limit_dns_zone"] >= 0) {
$tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id"); $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_soa WHERE sys_groupid = $client_group_id");
if($tmp["number"] >= $client["limit_dns_zone"]) { if($tmp["number"] >= $client["limit_dns_zone"]) {
$app->error($app->tform->wordbook["limit_dns_zone_txt"]); $app->error($app->tform->wordbook["limit_dns_zone_txt"]);
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment