Skip to content

Commit 1c89972

Browse files
author
Thomas Pike
committed
Only allow admins to enable/disable DNSSEC on a zone
1 parent 065acb2 commit 1c89972

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

templates/zone.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@
512512
</div>
513513
</div>
514514
<?php } ?>
515+
<?php } else { ?>
516+
<p>DNSSEC is not currently enabled for this zone.</p>
517+
<?php } ?>
518+
<?php if($active_user->admin) { ?>
519+
<?php if($zone->dnssec) { ?>
515520
<h3>Disable DNSSEC</h3>
516521
<form method="post" action="/zones/<?php out(DNSZoneName::unqualify($zone->name), ESC_URL)?>" class="disablednssec">
517522
<?php out($this->get('active_user')->get_csrf_field(), ESC_NONE) ?>
@@ -532,6 +537,7 @@
532537
</p>
533538
</form>
534539
<?php } ?>
540+
<?php } ?>
535541
</div>
536542
<?php } ?>
537543
<div role="tabpanel" class="tab-pane" id="import">

views/zone.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@
208208
$zone->process_bulk_json_rrset_update(json_encode($json));
209209
}
210210
redirect();
211-
} elseif(isset($_POST['enable_dnssec'])) {
211+
} elseif(isset($_POST['enable_dnssec']) && $active_user->admin) {
212212
$zone->dnssec = 1;
213213
$zone->update();
214214
redirect();
215-
} elseif(isset($_POST['disable_dnssec'])) {
215+
} elseif(isset($_POST['disable_dnssec']) && $active_user->admin) {
216216
$zone->dnssec = 0;
217217
$zone->update();
218218
redirect();

0 commit comments

Comments
 (0)