Skip to content

Commit eef23e3

Browse files
committed
Allow for serial to be increased when deleting any record in the zone
1 parent f2ac1a5 commit eef23e3

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

interface/lib/classes/remote.d/dns.inc.php

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,14 @@ public function dns_aaaa_update($session_id, $client_id, $primary_id, $params, $
324324
}
325325

326326
//* Delete a record
327-
public function dns_aaaa_delete($session_id, $primary_id)
327+
public function dns_aaaa_delete($session_id, $primary_id, $update_serial=false)
328328
{
329329
if(!$this->checkPerm($session_id, 'dns_aaaa_delete')) {
330330
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
331331
return false;
332332
}
333333
$affected_rows = $this->deleteQuery('../dns/form/dns_aaaa.tform.php', $primary_id);
334+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
334335
return $affected_rows;
335336
}
336337

@@ -374,13 +375,14 @@ public function dns_a_update($session_id, $client_id, $primary_id, $params, $upd
374375
}
375376

376377
//* Delete a record
377-
public function dns_a_delete($session_id, $primary_id)
378+
public function dns_a_delete($session_id, $primary_id, $update_serial=false)
378379
{
379380
if(!$this->checkPerm($session_id, 'dns_a_delete')) {
380381
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
381382
return false;
382383
}
383384
$affected_rows = $this->deleteQuery('../dns/form/dns_a.tform.php', $primary_id);
385+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
384386
return $affected_rows;
385387
}
386388

@@ -424,13 +426,14 @@ public function dns_alias_update($session_id, $client_id, $primary_id, $params,
424426
}
425427

426428
//* Delete a record
427-
public function dns_alias_delete($session_id, $primary_id)
429+
public function dns_alias_delete($session_id, $primary_id, $update_serial=false)
428430
{
429431
if(!$this->checkPerm($session_id, 'dns_alias_delete')) {
430432
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
431433
return false;
432434
}
433435
$affected_rows = $this->deleteQuery('../dns/form/dns_alias.tform.php', $primary_id);
436+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
434437
return $affected_rows;
435438
}
436439

@@ -474,13 +477,14 @@ public function dns_cname_update($session_id, $client_id, $primary_id, $params,
474477
}
475478

476479
//* Delete a record
477-
public function dns_cname_delete($session_id, $primary_id)
480+
public function dns_cname_delete($session_id, $primary_id, $update_serial=false)
478481
{
479482
if(!$this->checkPerm($session_id, 'dns_cname_delete')) {
480483
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
481484
return false;
482485
}
483486
$affected_rows = $this->deleteQuery('../dns/form/dns_cname.tform.php', $primary_id);
487+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
484488
return $affected_rows;
485489
}
486490

@@ -524,13 +528,14 @@ public function dns_hinfo_update($session_id, $client_id, $primary_id, $params,
524528
}
525529

526530
//* Delete a record
527-
public function dns_hinfo_delete($session_id, $primary_id)
531+
public function dns_hinfo_delete($session_id, $primary_id, $update_serial=false)
528532
{
529533
if(!$this->checkPerm($session_id, 'dns_hinfo_delete')) {
530534
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
531535
return false;
532536
}
533537
$affected_rows = $this->deleteQuery('../dns/form/dns_hinfo.tform.php', $primary_id);
538+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
534539
return $affected_rows;
535540
}
536541

@@ -574,13 +579,14 @@ public function dns_mx_update($session_id, $client_id, $primary_id, $params, $up
574579
}
575580

576581
//* Delete a record
577-
public function dns_mx_delete($session_id, $primary_id)
582+
public function dns_mx_delete($session_id, $primary_id, $update_serial=false)
578583
{
579584
if(!$this->checkPerm($session_id, 'dns_mx_delete')) {
580585
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
581586
return false;
582587
}
583588
$affected_rows = $this->deleteQuery('../dns/form/dns_mx.tform.php', $primary_id);
589+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
584590
return $affected_rows;
585591
}
586592

@@ -624,13 +630,14 @@ public function dns_ns_update($session_id, $client_id, $primary_id, $params, $up
624630
}
625631

626632
//* Delete a record
627-
public function dns_ns_delete($session_id, $primary_id)
633+
public function dns_ns_delete($session_id, $primary_id, $update_serial=false)
628634
{
629635
if(!$this->checkPerm($session_id, 'dns_ns_delete')) {
630636
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
631637
return false;
632638
}
633639
$affected_rows = $this->deleteQuery('../dns/form/dns_ns.tform.php', $primary_id);
640+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
634641
return $affected_rows;
635642
}
636643

@@ -674,13 +681,14 @@ public function dns_ptr_update($session_id, $client_id, $primary_id, $params, $u
674681
}
675682

676683
//* Delete a record
677-
public function dns_ptr_delete($session_id, $primary_id)
684+
public function dns_ptr_delete($session_id, $primary_id, $update_serial=false)
678685
{
679686
if(!$this->checkPerm($session_id, 'dns_ptr_delete')) {
680687
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
681688
return false;
682689
}
683690
$affected_rows = $this->deleteQuery('../dns/form/dns_ptr.tform.php', $primary_id);
691+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
684692
return $affected_rows;
685693
}
686694

@@ -724,13 +732,14 @@ public function dns_rp_update($session_id, $client_id, $primary_id, $params, $up
724732
}
725733

726734
//* Delete a record
727-
public function dns_rp_delete($session_id, $primary_id)
735+
public function dns_rp_delete($session_id, $primary_id, $update_serial=false)
728736
{
729737
if(!$this->checkPerm($session_id, 'dns_rp_delete')) {
730738
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
731739
return false;
732740
}
733741
$affected_rows = $this->deleteQuery('../dns/form/dns_rp.tform.php', $primary_id);
742+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
734743
return $affected_rows;
735744
}
736745

@@ -774,13 +783,14 @@ public function dns_srv_update($session_id, $client_id, $primary_id, $params, $u
774783
}
775784

776785
//* Delete a record
777-
public function dns_srv_delete($session_id, $primary_id)
786+
public function dns_srv_delete($session_id, $primary_id, $update_serial=false)
778787
{
779788
if(!$this->checkPerm($session_id, 'dns_srv_delete')) {
780789
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
781790
return false;
782791
}
783792
$affected_rows = $this->deleteQuery('../dns/form/dns_srv.tform.php', $primary_id);
793+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
784794
return $affected_rows;
785795
}
786796

@@ -824,13 +834,14 @@ public function dns_txt_update($session_id, $client_id, $primary_id, $params, $u
824834
}
825835

826836
//* Delete a record
827-
public function dns_txt_delete($session_id, $primary_id)
837+
public function dns_txt_delete($session_id, $primary_id, $update_serial=false)
828838
{
829839
if(!$this->checkPerm($session_id, 'dns_txt_delete')) {
830840
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
831841
return false;
832842
}
833843
$affected_rows = $this->deleteQuery('../dns/form/dns_txt.tform.php', $primary_id);
844+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
834845
return $affected_rows;
835846
}
836847

0 commit comments

Comments
 (0)