Skip to content

Commit 04b0eb2

Browse files
author
Till Brehm
committed
Fixed #5425 Valid delete requests blocked by CSRF check
1 parent 2f0d607 commit 04b0eb2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

interface/lib/classes/plugin_listview.inc.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ function onShow() {
123123
$lng_file = "lib/lang/".$app->functions->check_language($_SESSION["s"]["language"])."_".$app->listform->listDef['name']."_list.lng";
124124
include $lng_file;
125125
$listTpl->setVar($wb);
126+
127+
$csrf_token = $app->auth->csrf_token_get($app->listform->listDef['name']);
128+
$_csrf_id = $csrf_token['csrf_id'];
129+
$_csrf_key = $csrf_token['csrf_key'];
126130

127131

128132
// Get the data
@@ -157,6 +161,10 @@ function onShow() {
157161
// The variable "id" contains always the index field
158162
$rec["id"] = $rec[$idx_key];
159163
$rec["delete_confirmation"] = $wb['delete_confirmation'];
164+
165+
// CSRF Token
166+
$rec["csrf_id"] = $_csrf_id;
167+
$rec["csrf_key"] = $_csrf_key;
160168

161169
$records_new[] = $rec;
162170
}

interface/web/admin/templates/remote_user_list.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
3333
<td><a href="#" data-load-content="admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}">{tmpl_var name="remote_userid"}</a></td>
3434
<td><a href="#" data-load-content="admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}">{tmpl_var name="remote_username"}</a></td>
3535
<td class="text-right">
36-
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/remote_user_del.php?id={tmpl_var name='remote_userid'}&phpsessid={tmpl_var name='phpsessid'}','{tmpl_var name='delete_confirmation'}');"><span class="icon icon-delete"></span></a>
36+
<a class="btn btn-default formbutton-danger formbutton-narrow" href="javascript: ISPConfig.confirm_action('admin/remote_user_del.php?id={tmpl_var name='remote_userid'}&_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>
3737
</td>
3838
</tr>
3939
</tmpl_loop>

0 commit comments

Comments
 (0)