Skip to content

Commit 9b8e5e5

Browse files
committed
Add a delete button to the DNS zone settings page
1 parent 329b30d commit 9b8e5e5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

interface/web/dns/dns_soa_edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,14 @@ function onShowEnd() {
227227
}
228228
}
229229

230+
$csrf_token = $app->auth->csrf_token_get('dns_soa_del');
231+
$app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
232+
$app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']);
233+
234+
$global_config = $app->getconf->get_global_config();
235+
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
236+
237+
230238
} else {
231239
$app->tpl->setVar("edit_disabled", 0);
232240
}

interface/web/dns/templates/dns_soa_edit.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@
173173
<input type="hidden" name="id" value="{tmpl_var name='id'}">
174174
<input name="serial" type="hidden" value="{tmpl_var name='serial'}">
175175
<div class="clear">
176+
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
177+
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('dns/dns_soa_del.php?id={tmpl_var name='id'}&_csrf_id={tmpl_var name='_csrf_id'}&_csrf_key={tmpl_var name='_csrf_key'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name
178+
='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
179+
</tmpl_if></tmpl_if>
176180
<div class="right">
177181
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="dns/dns_soa_edit.php">{tmpl_var name='btn_save_txt'}</button>
178182
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="dns/dns_soa_list.php">{tmpl_var name='btn_cancel_txt'}</button>

0 commit comments

Comments
 (0)