more csrf protection for invoice and search (#2984)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
{% macro invoice(invoice, view) %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
{% set event = actions(app.user, 'invoice', view, {'invoice': invoice, 'token': csrf_token('invoice.delete')}) %}
|
||||
{% set event = actions(app.user, 'invoice', view, {'invoice': invoice, 'token': csrf_token('invoice.status')}) %}
|
||||
{{ widgets.table_actions(event.actions) }}
|
||||
{% endmacro %}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
const overwrites = {'customers[]': link.dataset['customer'], 'template': link.dataset['template']};
|
||||
const uri = formPlugin.convertFormDataToQueryString(document.getElementById('{{ formId }}'), overwrites);
|
||||
|
||||
link.href = link.dataset['href'] + '?' + uri;
|
||||
link.href = link.dataset['href'] + '?token={{ csrf_token('invoice.create') }}&' + uri;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -228,7 +228,7 @@
|
||||
const formPlugin = kimai.getPlugin('form');
|
||||
const uri = formPlugin.convertFormDataToQueryString(document.getElementById('{{ formId }}'));
|
||||
|
||||
link.href = '{{ path('invoice') }}?createInvoice=true&' + uri;
|
||||
link.href = '{{ path('invoice') }}?token={{ csrf_token('invoice.create') }}&createInvoice=true&' + uri;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user