10000 Use allowsAnonymous()/isSecurityEnabled() in template, update labels … · symfony/symfony@73fe755 · GitHub
[go: up one dir, main page]

Skip to content

Commit 73fe755

Browse files
committed
Use allowsAnonymous()/isSecurityEnabled() in template, update labels accordingly
1 parent 1d2167b commit 73fe755

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,13 @@ public function collect(Request $request, Response $response, \Exception $except
130130
}
131131

132132
// collect firewall context informations
133+
$this->data['firewall'] = null;
133134
if ($this->firewallMap instanceof ContextAwareFirewallMapInterface) {
134135
$firewallContext = $this->firewallMap->getContext($request);
135136

136137
if (null !== $firewallContext) {
137138
$this->data['firewall'] = $firewallContext->getConfig();
138139
}
139-
} else {
140-
$this->data['firewall'] = array();
141140
}
142141
}
143142

src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,26 +128,26 @@
128128

129129
<h2>Security Firewall</h2>
130130

131-
{% if collector.firewall|default([]) is not empty %}
131+
{% if collector.firewall %}
132132
<div class="metrics">
133133
<div class="metric">
134134
<span class="value">{{ collector.firewall.name }}</span>
135135
<span class="label">Name</span>
136136
</div>
137137
<div class="metric">
138-
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.security ? 'yes' : 'no') ~ '.svg') }}</span>
139-
<span class="label">Security</span>
138+
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.securityEnabled ? 'yes' : 'no') ~ '.svg') }}</span>
139+
<span class="label">Security enabled</span>
140140
</div>
141141
<div class="metric">
142142
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.stateless ? 'yes' : 'no') ~ '.svg') }}</span>
143143
<span class="label">Stateless</span>
144144
</div>
145145
<div class="metric">
146-
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.listenerConfigs.anonymous is defined ? 'yes' : 'no') ~ '.svg') }}</span>
147-
<span class="label">Anonymous</span>
146+
<span class="value">{{ include('@WebProfiler/Icon/' ~ (collector.firewall.allowsAnonymous ? 'yes' : 'no') ~ '.svg') }}</span>
147+
<span class="label">Allow Anonymous</span>
148148
</div>
149149
</div>
150-
{% if collector.firewall.security %}
150+
{% if collector.firewall.securityEnabled %}
151151
<table>
152152
<thead>
153153
<tr>
@@ -182,12 +182, 9105 7 @@
182182
</tr>
183183
<tr>
184184
<th>listeners</th>
185-
<td>
186-
{% for name, listener in collector.firewall.listenerConfigs %}
187-
{{ name }}
188-
{{ profiler_dump(listener) }} <br>
189-
{% endfor %}
190-
</td>
185+
<td>{{ collector.firewall.listeners|yaml_encode }}</td>
191186
</tr>
192187
</tbody>
193188
</table>

0 commit comments

Comments
 (0)
0