Skip to content

Commit

Permalink
Only allow admins to enable/disable DNSSEC on a zone
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Pike committed Apr 23, 2018
1 parent 065acb2 commit 1c89972
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions templates/zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,11 @@
</div>
</div>
<?php } ?>
<?php } else { ?>
<p>DNSSEC is not currently enabled for this zone.</p>
<?php } ?>
<?php if($active_user->admin) { ?>
<?php if($zone->dnssec) { ?>
<h3>Disable DNSSEC</h3>
<form method="post" action="/zones/<?php out(DNSZoneName::unqualify($zone->name), ESC_URL)?>" class="disablednssec">
<?php out($this->get('active_user')->get_csrf_field(), ESC_NONE) ?>
Expand All @@ -532,6 +537,7 @@
</p>
</form>
<?php } ?>
<?php } ?>
</div>
<?php } ?>
<div role="tabpanel" class="tab-pane" id="import">
Expand Down
4 changes: 2 additions & 2 deletions views/zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@
$zone->process_bulk_json_rrset_update(json_encode($json));
}
redirect();
} elseif(isset($_POST['enable_dnssec'])) {
} elseif(isset($_POST['enable_dnssec']) && $active_user->admin) {
$zone->dnssec = 1;
$zone->update();
redirect();
} elseif(isset($_POST['disable_dnssec'])) {
} elseif(isset($_POST['disable_dnssec']) && $active_user->admin) {
$zone->dnssec = 0;
$zone->update();
redirect();
Expand Down

0 comments on commit 1c89972

Please sign in to comment.