From e1ceb050e19c7574bca146a8da7047ee4ff456b5 Mon Sep 17 00:00:00 2001 From: Marius Burkard <m.burkard@pixcept.de> Date: Sun, 10 Jul 2016 05:02:35 -0400 Subject: [PATCH] Merge branch 'stable-3.1' --- interface/web/dns/dns_soa_edit.php | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php index 96c20a1..d6a20df 100644 --- a/interface/web/dns/dns_soa_edit.php +++ b/interface/web/dns/dns_soa_edit.php @@ -150,7 +150,7 @@ $options_dns_servers = ""; foreach ($dns_servers as $dns_server) { - $options_dns_servers .= "<option value='$dns_server[server_id]'>$dns_server[server_name]</option>"; + $options_dns_servers .= '<option value="'.$dns_server['server_id'].'"'.($this->id > 0 && $this->dataRecord["server_id"] == $dns_server['server_id'] ? ' selected="selected"' : '').'>'.$dns_server['server_name'].'</option>'; } $app->tpl->setVar("client_server_id", $options_dns_servers); @@ -273,16 +273,14 @@ //* Check if the server has been changed // We do this only for the admin or reseller users, as normal clients can not change the server ID anyway - if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid'])) { + if($_SESSION["s"]["user"]["typ"] != 'admin' && !$app->auth->has_clients($_SESSION['s']['user']['userid']) && isset($this->dataRecord['origin'])) { //* We do not allow users to change a domain which has been created by the admin $rec = $app->db->queryOneRecord("SELECT origin from dns_soa WHERE id = ?", $this->id); - $drOrigin = (isset($this->dataRecord['origin'])) - ? $app->functions->idn_encode($this->dataRecord['origin']) - : false; + $drOrigin = $app->functions->idn_encode($this->dataRecord['origin']); if($rec['origin'] !== $drOrigin && $app->tform->checkPerm($this->id, 'u')) { //* Add a error message and switch back to old server - $app->tform->errorMessage .= $app->lng('The Zone (soa) can not be changed. Please ask your Administrator if you want to change the Zone name.'); + $app->tform->errorMessage .= $app->tform->wordbook["soa_cannot_be_changed_txt"]; $this->dataRecord["origin"] = $rec['origin']; } unset($rec); -- Gitblit v1.9.1