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;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro searchButton(form) %}
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('search') }}">
|
||||
<div class="btn-group">
|
||||
<button type="submit" name="performSearch" value="performSearch" class="btn btn-primary pull-left" data-type="submit">{{ 'search'|trans }}</button>
|
||||
</div>
|
||||
@@ -56,7 +57,7 @@
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a href="?removeDefaultQuery={{ form.vars.data.bookmark.name }}" id="removeDefaultQuery">{{ 'label.remove_default'|trans }}</a>
|
||||
<a href="?_token={{ csrf_token('search') }}&removeDefaultQuery={{ form.vars.data.bookmark.name }}" id="removeDefaultQuery">{{ 'label.remove_default'|trans }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user