Skip to content

Commit e628615

Browse files
author
Till Brehm
committed
Merge branch 'stable-3.1' into 'stable-3.1'
Allow for serial to be increased when deleting any record in the zone See merge request ispconfig/ispconfig3!773
2 parents 515de02 + 5ad41e5 commit e628615

File tree

1 file changed

+44
-33
lines changed

1 file changed

+44
-33
lines changed

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

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function dns_aaaa_add($session_id, $client_id, $params, $update_serial=fa
307307
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
308308
return false;
309309
}
310-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
310+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
311311
return $this->insertQuery('../dns/form/dns_aaaa.tform.php', $client_id, $params);
312312
}
313313

@@ -319,18 +319,19 @@ public function dns_aaaa_update($session_id, $client_id, $primary_id, $params, $
319319
return false;
320320
}
321321
$affected_rows = $this->updateQuery('../dns/form/dns_aaaa.tform.php', $client_id, $primary_id, $params);
322-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
322+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
323323
return $affected_rows;
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

@@ -357,7 +358,7 @@ public function dns_a_add($session_id, $client_id, $params, $update_serial=false
357358
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
358359
return false;
359360
}
360-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
361+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
361362
return $this->insertQuery('../dns/form/dns_a.tform.php', $client_id, $params);
362363
}
363364

@@ -368,19 +369,20 @@ public function dns_a_update($session_id, $client_id, $primary_id, $params, $upd
368369
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
369370
return false;
370371
}
371-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
372+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
372373
$affected_rows = $this->updateQuery('../dns/form/dns_a.tform.php', $client_id, $primary_id, $params);
373374
return $affected_rows;
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

@@ -407,7 +409,7 @@ public function dns_alias_add($session_id, $client_id, $params, $update_serial=f
407409
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
408410
return false;
409411
}
410-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
412+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
411413
return $this->insertQuery('../dns/form/dns_alias.tform.php', $client_id, $params);
412414
}
413415

@@ -418,19 +420,20 @@ public function dns_alias_update($session_id, $client_id, $primary_id, $params,
418420
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
419421
return false;
420422
}
421-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
423+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
422424
$affected_rows = $this->updateQuery('../dns/form/dns_alias.tform.php', $client_id, $primary_id, $params);
423425
return $affected_rows;
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

@@ -457,7 +460,7 @@ public function dns_cname_add($session_id, $client_id, $params, $update_serial=f
457460
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
458461
return false;
459462
}
460-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
463+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
461464
return $this->insertQuery('../dns/form/dns_cname.tform.php', $client_id, $params);
462465
}
463466

@@ -468,19 +471,20 @@ public function dns_cname_update($session_id, $client_id, $primary_id, $params,
468471
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
469472
return false;
470473
}
471-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
474+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
472475
$affected_rows = $this->updateQuery('../dns/form/dns_cname.tform.php', $client_id, $primary_id, $params);
473476
return $affected_rows;
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

@@ -507,7 +511,7 @@ public function dns_hinfo_add($session_id, $client_id, $params, $update_serial=f
507511
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
508512
return false;
509513
}
510-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
514+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
511515
return $this->insertQuery('../dns/form/dns_hinfo.tform.php', $client_id, $params);
512516
}
513517

@@ -518,19 +522,20 @@ public function dns_hinfo_update($session_id, $client_id, $primary_id, $params,
518522
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
519523
return false;
520524
}
521-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
525+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
522526
$affected_rows = $this->updateQuery('../dns/form/dns_hinfo.tform.php', $client_id, $primary_id, $params);
523527
return $affected_rows;
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

@@ -557,7 +562,7 @@ public function dns_mx_add($session_id, $client_id, $params, $update_serial=fals
557562
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
558563
return false;
559564
}
560-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
565+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
561566
return $this->insertQuery('../dns/form/dns_mx.tform.php', $client_id, $params);
562567
}
563568

@@ -568,19 +573,20 @@ public function dns_mx_update($session_id, $client_id, $primary_id, $params, $up
568573
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
569574
return false;
570575
}
571-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
576+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
572577
$affected_rows = $this->updateQuery('../dns/form/dns_mx.tform.php', $client_id, $primary_id, $params);
573578
return $affected_rows;
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

@@ -607,7 +613,7 @@ public function dns_ns_add($session_id, $client_id, $params, $update_serial=fals
607613
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
608614
return false;
609615
}
610-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
616+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
611617
return $this->insertQuery('../dns/form/dns_ns.tform.php', $client_id, $params);
612618
}
613619

@@ -618,19 +624,20 @@ public function dns_ns_update($session_id, $client_id, $primary_id, $params, $up
618624
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
619625
return false;
620626
}
621-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
627+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
622628
$affected_rows = $this->updateQuery('../dns/form/dns_ns.tform.php', $client_id, $primary_id, $params);
623629
return $affected_rows;
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

@@ -657,7 +664,7 @@ public function dns_ptr_add($session_id, $client_id, $params, $update_serial=fal
657664
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
658665
return false;
659666
}
660-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
667+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
661668
return $this->insertQuery('../dns/form/dns_ptr.tform.php', $client_id, $params);
662669
}
663670

@@ -668,19 +675,20 @@ public function dns_ptr_update($session_id, $client_id, $primary_id, $params, $u
668675
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
669676
return false;
670677
}
671-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
678+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
672679
$affected_rows = $this->updateQuery('../dns/form/dns_ptr.tform.php', $client_id, $primary_id, $params);
673680
return $affected_rows;
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

@@ -707,7 +715,7 @@ public function dns_rp_add($session_id, $client_id, $params, $update_serial=fals
707715
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
708716
return false;
709717
}
710-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
718+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
711719
return $this->insertQuery('../dns/form/dns_rp.tform.php', $client_id, $params);
712720
}
713721

@@ -718,19 +726,20 @@ public function dns_rp_update($session_id, $client_id, $primary_id, $params, $up
718726
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
719727
return false;
720728
}
721-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
729+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
722730
$affected_rows = $this->updateQuery('../dns/form/dns_rp.tform.php', $client_id, $primary_id, $params);
723731
return $affected_rows;
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

@@ -757,7 +766,7 @@ public function dns_srv_add($session_id, $client_id, $params, $update_serial=fal
757766
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
758767
return false;
759768
}
760-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
769+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
761770
return $this->insertQuery('../dns/form/dns_srv.tform.php', $client_id, $params);
762771
}
763772

@@ -768,19 +777,20 @@ public function dns_srv_update($session_id, $client_id, $primary_id, $params, $u
768777
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
769778
return false;
770779
}
771-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
780+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
772781
$affected_rows = $this->updateQuery('../dns/form/dns_srv.tform.php', $client_id, $primary_id, $params);
773782
return $affected_rows;
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

@@ -807,7 +817,7 @@ public function dns_txt_add($session_id, $client_id, $params, $update_serial=fal
807817
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
808818
return false;
809819
}
810-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
820+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
811821
return $this->insertQuery('../dns/form/dns_txt.tform.php', $client_id, $params);
812822
}
813823

@@ -818,19 +828,20 @@ public function dns_txt_update($session_id, $client_id, $primary_id, $params, $u
818828
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
819829
return false;
820830
}
821-
if($update_serial != false) $this->increase_serial($session_id, $client_id, $params);
831+
if($update_serial) $this->increase_serial($session_id, $client_id, $params);
822832
$affected_rows = $this->updateQuery('../dns/form/dns_txt.tform.php', $client_id, $primary_id, $params);
823833
return $affected_rows;
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)