Skip to content

Commit 3625a6e

Browse files
committed
minor symfony#20405 [SecurityBundle] Display firewall in debug bar even if not authenticated (chalasr)
This PR was squashed before being merged into the 3.2-dev branch (closes symfony#20405). Discussion ---------- [SecurityBundle] Display firewall in debug bar even if not authenticated | Q | A | ------------- | --- | Branch? | master | Tests pass? | yes | License | MIT Before: ![before](http://image.prntscr.com/image/897d1f2b43d64c5a8e15a95bf927a01c.png) After: ![after](http://image.prntscr.com/image/4491a3aea6fe44dd8ca24a2b25a37596.png) I will take any input to improve the result, I feel it not optimal. Commits ------- d81da79 [SecurityBundle] Display firewall in debug bar even if not authenticated
2 parents fc557db + d81da79 commit 3625a6e

File tree

1 file changed

+29
-27
lines changed

1 file changed

+29
-27
lines changed

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

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,41 @@
1616
{% endset %}
1717

1818
{% set text %}
19-
{% if collector.token %}
20-
<div class="sf-toolbar-info-piece">
21-
<b>Logged in as</b>
22-
<span>{{ collector.user }}</span>
23-
</div>
19+
{% if collector.enabled %}
20+
{% if collector.token %}
21+
<div class="sf-toolbar-info-piece">
22+
<b>Logged in as</b>
23+
<span>{{ collector.user }}</span>
24+
</div>
2425

25-
<div class="sf-toolbar-info-piece">
26-
<b>Authenticated</b>
27-
<span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'red' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span>
28-
</div>
26+
<div class="sf-toolbar-info-piece">
27+
<b>Authenticated</b>
28+
<span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'red' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span>
29+
</div>
2930

30-
{% if collector.token != null %}
31-
<div class="sf-toolbar-info-piece">
32-
<b>Token class</b>
33-
<span>{{ collector.tokenClass|abbr_class }}</span>
34-
</div>
31+
<div class="sf-toolbar-info-piece">
32+
<b>Token class</b>
33+
<span>{{ collector.tokenClass|abbr_class }}</span>
34+
</div>
35+
{% else %}
36+
<div class="sf-toolbar-info-piece">
37+
<span>You are not authenticated.</span>
38+
</div>
3539
{% endif %}
40+
3641
{% if collector.firewall %}
37-
<div class="sf-toolbar-info-piece">
38-
<b>Firewall name</b>
39-
<span>{{ collector.firewall.name }}</span>
40-
</div>
42+
<div class="sf-toolbar-info-piece">
43+
<b>Firewall name</b>
44+
<span>{{ collector.firewall.name }}</span>
45+
</div>
4146
{% endif %}
42-
{% if collector.logoutUrl %}
43-
<div class="sf-toolbar-info-piece">
44-
<b>Actions</b>
45-
<span><a href="{{ collector.logoutUrl }}">Logout</a></span>
46-
</div>
47+
48+
{% if collector.token and collector.logoutUrl %}
49+
<div class="sf-toolbar-info-piece">
50+
<b>Actions</b>
51+
<span><a href="{{ collector.logoutUrl }}">Logout</a></span>
52+
</div>
4753
{% endif %}
48-
{% elseif collector.enabled %}
49-
<div class="sf-toolbar-info-piece">
50-
<span>You are not authenticated.</span>
51-
</div>
5254
{% else %}
5355
<div class="sf-toolbar-info-piece">
5456
<span>The security is disabled.</span>

0 commit comments

Comments
 (0)