Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Carlos Gonzalez
ISPConfig 3
Commits
dc6e082d
Commit
dc6e082d
authored
Jul 31, 2018
by
Till Brehm
Browse files
Fixes #5095 update serial when DNS records are deleted with remote api.
parent
09a9ecbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/remote.d/dns.inc.php
View file @
dc6e082d
...
...
@@ -331,7 +331,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_aaaa.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -382,7 +382,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_a.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -433,7 +433,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_alias.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -484,7 +484,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_cname.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -535,7 +535,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_hinfo.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -586,7 +586,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_mx.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -637,7 +637,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_ns.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -688,7 +688,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_ptr.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -739,7 +739,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_rp.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -790,7 +790,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_srv.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -841,7 +841,7 @@ class remoting_dns extends remoting {
return
false
;
}
$affected_rows
=
$this
->
deleteQuery
(
'../dns/form/dns_txt.tform.php'
,
$primary_id
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
$params
);
if
(
$update_serial
)
$this
->
increase_serial
(
$session_id
,
$client_id
,
array
(
'dns_rr_id'
=>
$primary_id
)
);
return
$affected_rows
;
}
...
...
@@ -916,6 +916,12 @@ class remoting_dns extends remoting {
}
private
function
increase_serial
(
$session_id
,
$client_id
,
$params
)
{
global
$app
;
if
(
!
isset
(
$params
[
'zone'
])
&&
isset
(
$params
[
'dns_rr_id'
]))
{
$tmp
=
$app
->
db
->
queryOneRecord
(
'SELECT zone FROM dns_rr WHERE id = ?'
,
$params
[
'dns_rr_id'
]);
$params
[
'zone'
]
=
$tmp
[
'zone'
];
unset
(
$tmp
);
}
$soa
=
$this
->
dns_zone_get
(
$session_id
,
$params
[
'zone'
]);
$serial
=
$soa
[
'serial'
];
$serial_date
=
intval
(
substr
(
$serial
,
0
,
8
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment