Skip to content
Snippets Groups Projects
Commit 04b0eb24 authored by Till Brehm's avatar Till Brehm
Browse files

Fixed #5425 Valid delete requests blocked by CSRF check

parent 2f0d607b
No related branches found
No related tags found
No related merge requests found
......@@ -123,6 +123,10 @@ class plugin_listview extends plugin_base {
$lng_file = "lib/lang/".$app->functions->check_language($_SESSION["s"]["language"])."_".$app->listform->listDef['name']."_list.lng";
include $lng_file;
$listTpl->setVar($wb);
$csrf_token = $app->auth->csrf_token_get($app->listform->listDef['name']);
$_csrf_id = $csrf_token['csrf_id'];
$_csrf_key = $csrf_token['csrf_key'];
// Get the data
......@@ -157,6 +161,10 @@ class plugin_listview extends plugin_base {
// The variable "id" contains always the index field
$rec["id"] = $rec[$idx_key];
$rec["delete_confirmation"] = $wb['delete_confirmation'];
// CSRF Token
$rec["csrf_id"] = $_csrf_id;
$rec["csrf_key"] = $_csrf_key;
$records_new[] = $rec;
}
......
......@@ -33,7 +33,7 @@
<td><a href="#" data-load-content="admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}">{tmpl_var name="remote_userid"}</a></td>
<td><a href="#" data-load-content="admin/remote_user_edit.php?id={tmpl_var name='remote_userid'}">{tmpl_var name="remote_username"}</a></td>
<td class="text-right">
<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>
<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>
</td>
</tr>
</tmpl_loop>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment