Skip to content

Commit fdd6fee

Browse files
committed
1 parent 6ecc560 commit fdd6fee

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

interface/web/dns/list/rr.list.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
$liste["paging_tpl"] = "templates/paging.tpl.htm";
4141

4242
// Enable auth
43-
$liste["auth"] = "no";
43+
$liste["auth"] = "yes";
4444

4545

4646
/*****************************************************

interface/web/dns/rr_edit.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,29 @@ function onSubmit() {
118118

119119
// if IP address changes, delete/change old PTR record
120120
if(!empty($old_record)){
121+
122+
123+
124+
121125
list($oa, $ob, $oc, $od) = explode('.', $old_record['data']);
126+
$old_ptr_soa = $oc.'.'.$ob.'.'.$oa.'.in-addr.arpa.';
127+
$old_ptr_soa_exist = $app->db->queryOneRecord("SELECT * FROM soa WHERE origin = '".$old_ptr_soa."'");
128+
if(substr($old_record['name'], -1) == '.'){
129+
$old_ptr_soa_rr_data = $old_record['name'];
130+
} else {
131+
$old_ptr_soa_rr_data = $old_record['name'].(trim($old_record['name']) == '' ? '' : '.').$soa['origin'];
132+
}
133+
if(!$app->db->queryOneRecord("SELECT * FROM rr WHERE zone = '".$old_ptr_soa_exist['id']."' AND name = '".$od."' AND type = 'PTR' AND data = '".$old_ptr_soa_rr_data."'")){
134+
parent::onSubmit();
135+
return true;
136+
}
122137

123138
if($old_record['data'] == $this->dataRecord['data']){
124139
$a_rr_with_same_ip = $this->dataRecord;
125140
$a_rr_with_same_ip['origin'] = $soa['origin'];
126141
} else {
127142
$a_rr_with_same_ip = $app->db->queryOneRecord("SELECT rr.*, soa.origin FROM rr, soa WHERE rr.type = 'A' AND rr.data = '".$old_record['data']."' AND rr.zone = soa.id AND soa.active = 'Y' AND rr.id != ".$this->dataRecord["id"]);
128143
}
129-
$old_ptr_soa = $oc.'.'.$ob.'.'.$oa.'.in-addr.arpa.';
130-
$old_ptr_soa_exist = $app->db->queryOneRecord("SELECT * FROM soa WHERE origin = '".$old_ptr_soa."'");
131144

132145
if($a_rr_with_same_ip){
133146
if(substr($a_rr_with_same_ip['name'], -1) == '.'){

0 commit comments

Comments
 (0)