Skip to content

Commit 7e67018

Browse files
committed
Add a delete button to the Client Domain edit page
1 parent 43b8fa5 commit 7e67018

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

interface/web/client/domain_edit.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ function onShowEnd() {
130130

131131
$app->tpl->setVar($wb);
132132

133+
$csrf_token = $app->auth->csrf_token_get('_domain_del');
134+
$app->tpl->setVar('_csrf_id', $csrf_token['csrf_id']);
135+
$app->tpl->setVar('_csrf_key', $csrf_token['csrf_key']);
136+
137+
$global_config = $app->getconf->get_global_config();
138+
$app->tpl->setVar('show_delete_on_forms', $global_config['misc']['show_delete_on_forms']);
139+
133140
parent::onShowEnd();
134141
}
135142

interface/web/client/templates/domain_edit.htm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919
<input type="hidden" name="id" value="{tmpl_var name='id'}">
2020
<input type="hidden" name="type" value="local">
2121

22-
<div class="clear"><div class="right">
22+
<div class="clear">
23+
<tmpl_if name='id'><tmpl_if name='show_delete_on_forms' op="==" value="y">
24+
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('client/domain_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='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
25+
</tmpl_if></tmpl_if>
26+
<div class="right">
2327
<button class="btn btn-default formbutton-success" type="button" value="{tmpl_var name='btn_save_txt'}" data-submit-form="pageForm" data-form-action="client/domain_edit.php">{tmpl_var name='btn_save_txt'}</button>
2428
<button class="btn btn-default formbutton-default" type="button" value="{tmpl_var name='btn_cancel_txt'}" data-load-content="client/domain_list.php">{tmpl_var name='btn_cancel_txt'}</button>
2529
</div></div>

0 commit comments

Comments
 (0)