Skip to content

Commit d36cf92

Browse files
Merge pull request #246 from tobias-93/fix-excel-security
Fix credentials checking in Excel builder when empty
2 parents 817c68d + 5e0ca9c commit d36cf92

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Resources/templates/CommonAdmin/ExcelAction/ExcelBuilderAction.php.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class ExcelController extends \{{ namespace_prefix }}\{{ bundle_name }}\Controll
8585
8686
$colNum = 0;
8787
{% for column in builder.columns %}
88-
{% if column.credentials is not empty %}
88+
{% if column.credentials is not empty and column.credentials is not same as('AdmingenAllowed') %}
8989
{% set credentials = column.credentials %}
9090
if ($this->validateCredentials('{{ credentials }}')) {
9191
{% endif %}
@@ -95,7 +95,7 @@ class ExcelController extends \{{ namespace_prefix }}\{{ bundle_name }}\Controll
9595
$sheet->getColumnDimension($columnLetter)->setAutoSize(true);
9696
9797
$colNum++;
98-
{% if column.credentials is not empty %}
98+
{% if column.credentials is not empty and column.credentials is not same as('AdmingenAllowed') %}
9999
}
100100
{% endif %}
101101
{% endfor %}
@@ -112,7 +112,7 @@ class ExcelController extends \{{ namespace_prefix }}\{{ bundle_name }}\Controll
112112
foreach($results as ${{ builder.ModelClass }}) {
113113
$colNum = 0;
114114
{% for name,column in builder.columns %}
115-
{% if column.credentials is not empty %}
115+
{% if column.credentials is not empty and column.credentials is not same as('AdmingenAllowed') %}
116116
{% set credentials = column.credentials %}
117117
if ($this->validateCredentials('{{ credentials }}', ${{ builder.ModelClass }})) {
118118
{% endif %}
@@ -125,7 +125,7 @@ class ExcelController extends \{{ namespace_prefix }}\{{ bundle_name }}\Controll
125125
}
126126
127127
$sheet->setCellValueByColumnAndRow($colNum, $row, $formatedValue);
128-
{% if column.credentials is not empty %}
128+
{% if column.credentials is not empty and column.credentials is not same as('AdmingenAllowed') %}
129129
}
130130
{% endif %}
131131
// Inc is outside of the credentials check to be sync with headers.

Resources/templates/CommonAdmin/security_action.php.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
{% if action is defined and action.credentials and action.credentials is not same as('AdmingenAllowed') %}
4343
$this->denyAccessUnlessValidateCredentials('{{ action.credentials }}');
4444
{% endif %}
45-
{% elseif credentials %}
45+
{% elseif credentials is defined and credentials is not same as('AdmingenAllowed') %}
4646
$this->denyAccessUnlessValidateCredentials('{{ credentials }}');
4747
{% endif %}
4848
{% endblock %}

0 commit comments

Comments
 (0)