From 236d796455c44b0ca40ca6582ae1fbb614f8bf21 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 03 Jan 2012 06:08:04 -0500
Subject: [PATCH] Fixed: FS#1858 - Old SSH-RSA Public Key not deleted from authorized_keys when deleted or changed
---
interface/web/dns/dns_soa_edit.php | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/interface/web/dns/dns_soa_edit.php b/interface/web/dns/dns_soa_edit.php
index 4c4d25a..7ec0278 100644
--- a/interface/web/dns/dns_soa_edit.php
+++ b/interface/web/dns/dns_soa_edit.php
@@ -50,6 +50,16 @@
class page_action extends tform_actions {
+ function onShow() {
+ global $app;
+ //* Reset the page number of the list form for the dns
+ //* records to 0 if we are on the first tab of the soa form.
+ if($app->tform->getNextTab() == 'dns_soa') {
+ $_SESSION['search']['dns_a']['page'] = 0;
+ }
+ parent::onShow();
+ }
+
function onShowNew() {
global $app, $conf;
@@ -76,10 +86,10 @@
$clients = $app->db->queryAllRecords($sql);
$client_select = '';
if($_SESSION["s"]["user"]["typ"] == 'admin') $client_select .= "<option value='0'></option>";
- $tmp_data_record = $app->tform->getDataRecord($this->id);
+ //$tmp_data_record = $app->tform->getDataRecord($this->id);
if(is_array($clients)) {
foreach( $clients as $client) {
- $selected = ($client["groupid"] == @$tmp_data_record["sys_groupid"])?'SELECTED':'';
+ $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
}
}
@@ -95,10 +105,10 @@
$clients = $app->db->queryAllRecords($sql);
$tmp = $app->db->queryOneRecord("SELECT groupid FROM sys_group WHERE client_id = ".$client['client_id']);
$client_select = '<option value="'.$tmp['groupid'].'">'.$client['contact_name'].'</option>';
- $tmp_data_record = $app->tform->getDataRecord($this->id);
+ //$tmp_data_record = $app->tform->getDataRecord($this->id);
if(is_array($clients)) {
foreach( $clients as $client) {
- $selected = @($client["groupid"] == $tmp_data_record["sys_groupid"])?'SELECTED':'';
+ $selected = @(is_array($this->dataRecord) && ($client["groupid"] == $this->dataRecord['client_group_id'] || $client["groupid"] == $this->dataRecord['sys_groupid']))?'SELECTED':'';
$client_select .= "<option value='$client[groupid]' $selected>$client[name]</option>\r\n";
}
}
@@ -154,7 +164,12 @@
if(stristr($this->dataRecord["mbox"],'@')) {
$this->dataRecord["mbox"] = str_replace('@','.',$this->dataRecord["mbox"]);
}
-
+
+ //* Check if a secondary zone with the same name already exists
+ $tmp = $app->db->queryOneRecord("SELECT count(id) as number FROM dns_slave WHERE origin = \"".$this->dataRecord["origin"]."\" AND server_id = \"".$this->dataRecord["server_id"]."\"");
+ if($tmp["number"] > 0) {
+ $app->error($app->tform->wordbook["origin_error_unique"]);
+ }
parent::onSubmit();
}
@@ -219,4 +234,4 @@
$page = new page_action;
$page->onLoad();
-?>
\ No newline at end of file
+?>
--
Gitblit v1.9.1