Skip to content

Commit 4f4b91f

Browse files
committed
Improved the DNS manager.
1 parent 8e23f2e commit 4f4b91f

File tree

11 files changed

+188
-12
lines changed

11 files changed

+188
-12
lines changed

install/sql/ispconfig3.sql

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,17 @@ CREATE TABLE `dns_rr` (
7777
`sys_perm_user` varchar(5) NOT NULL,
7878
`sys_perm_group` varchar(5) NOT NULL,
7979
`sys_perm_other` varchar(5) NOT NULL,
80+
`server_id` int(11) NOT NULL default '1',
8081
`zone` int(10) unsigned NOT NULL,
8182
`name` char(64) NOT NULL,
82-
`type` enum('A','AAAA','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') default NULL,
83+
`type` enum('A','AAAA','ALIAS','CNAME','HINFO','MX','NAPTR','NS','PTR','RP','SRV','TXT') default NULL,
8384
`data` char(128) NOT NULL,
84-
`aux` int(10) unsigned NOT NULL,
85+
`aux` int(10) unsigned NOT NULL default '0',
8586
`ttl` int(10) unsigned NOT NULL default '86400',
87+
`active` enum('N','Y') NOT NULL default 'Y',
8688
PRIMARY KEY (`id`),
8789
UNIQUE KEY `rr` (`zone`,`name`,`type`,`data`)
88-
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
89-
90-
--
91-
-- Daten für Tabelle `dns_rr`
92-
--
93-
90+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
9491

9592
-- --------------------------------------------------------
9693

@@ -105,6 +102,7 @@ CREATE TABLE `dns_soa` (
105102
`sys_perm_user` varchar(5) NOT NULL,
106103
`sys_perm_group` varchar(5) NOT NULL,
107104
`sys_perm_other` varchar(5) NOT NULL,
105+
`server_id` int(11) NOT NULL default '1',
108106
`origin` char(255) NOT NULL,
109107
`ns` char(255) NOT NULL,
110108
`mbox` char(255) NOT NULL,
@@ -119,11 +117,8 @@ CREATE TABLE `dns_soa` (
119117
PRIMARY KEY (`id`),
120118
UNIQUE KEY `origin` (`origin`),
121119
KEY `active` (`active`)
122-
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
120+
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
123121

124-
--
125-
-- Daten für Tabelle `dns_soa`
126-
--
127122

128123

129124
-- --------------------------------------------------------

interface/web/dns/dns_a_edit.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,25 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
126+
108127
}
109128

110129
$page = new page_action;

interface/web/dns/dns_alias_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_cname_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_hinfo_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_mx_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_ns_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_ptr_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_rp_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

interface/web/dns/dns_srv_edit.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ function onSubmit() {
105105

106106
parent::onSubmit();
107107
}
108+
109+
function onAfterInsert() {
110+
global $app, $conf;
111+
112+
// Update the serial number of the SOA record
113+
$soa_id = intval($_POST["zone"]);
114+
$serial = time();
115+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
116+
}
117+
118+
function onAfterUpdate() {
119+
global $app, $conf;
120+
121+
// Update the serial number of the SOA record
122+
$soa_id = intval($_POST["zone"]);
123+
$serial = time();
124+
$app->db->query("UPDATE dns_soa SET serial = $serial WHERE id = $soa_id");
125+
}
108126
}
109127

110128
$page = new page_action;

0 commit comments

Comments
 (0)