|
3 | 3 | {% block page_title 'Security' %}
|
4 | 4 |
|
5 | 5 | {% block toolbar %}
|
6 |
| - {% if collector.token %} |
7 |
| - {% set is_authenticated = collector.enabled and collector.authenticated %} |
8 |
| - {% set color_code = is_authenticated ? '' : 'yellow' %} |
9 |
| - {% elseif collector.enabled %} |
10 |
| - {% set color_code = collector.authenticatorManagerEnabled ? 'yellow' : 'red' %} |
11 |
| - {% else %} |
12 |
| - {% set color_code = '' %} |
13 |
| - {% endif %} |
14 |
| - |
15 |
| - {% set icon %} |
16 |
| - {{ include('@Security/Collector/icon.svg') }} |
17 |
| - <span class="sf-toolbar-value">{{ collector.user|default('n/a') }}</span> |
18 |
| - {% endset %} |
19 |
| - |
20 |
| - {% set text %} |
21 |
| - {% if collector.impersonated %} |
22 |
| - <div class="sf-toolbar-info-group"> |
23 |
| - <div class="sf-toolbar-info-piece"> |
24 |
| - <b>Impersonator</b> |
25 |
| - <span>{{ collector.impersonatorUser }}</span> |
26 |
| - </div> |
27 |
| - </div> |
| 6 | + {% if not collector.firewall %} |
| 7 | + {% if collector.token %} |
| 8 | + {% set is_authenticated = collector.enabled and collector.authenticated %} |
| 9 | + {% set color_code = is_authenticated ? '' : 'yellow' %} |
| 10 | + {% elseif collector.enabled %} |
| 11 | + {% set color_code = collector.authenticatorManagerEnabled ? 'yellow' : 'red' %} |
| 12 | + {% else %} |
| 13 | + {% set color_code = '' %} |
28 | 14 | {% endif %}
|
29 | 15 |
|
30 |
| - <div class="sf-toolbar-info-group"> |
31 |
| - {% if collector.enabled %} |
32 |
| - {% if collector.token %} |
33 |
| - <div class="sf-toolbar-info-piece"> |
34 |
| - <b>Logged in as</b> |
35 |
| - <span>{{ collector.user }}</span> |
36 |
| - </div> |
| 16 | + {% set icon %} |
| 17 | + {{ include('@Security/Collector/icon.svg') }} |
| 18 | + <span class="sf-toolbar-value">{{ collector.user|default('n/a') }}</span> |
| 19 | + {% endset %} |
37 | 20 |
|
| 21 | + {% set text %} |
| 22 | + {% if collector.impersonated %} |
| 23 | + <div class="sf-toolbar-info-group"> |
38 | 24 | <div class="sf-toolbar-info-piece">
|
39 |
| - <b>Authenticated</b> |
40 |
| - <span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'yellow' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span> |
| 25 | + <b>Impersonator</b> |
| 26 | + <span>{{ collector.impersonatorUser }}</span> |
41 | 27 | </div>
|
| 28 | + </div> |
| 29 | + {% endif %} |
42 | 30 |
|
43 |
| - <div class="sf-toolbar-info-piece"> |
44 |
| - <b>Token class</b> |
45 |
| - <span>{{ collector.tokenClass|abbr_class }}</span> |
46 |
| - </div> |
47 |
| - {% else %} |
48 |
| - <div class="sf-toolbar-info-piece"> |
49 |
| - <b>Authenticated</b> |
50 |
| - <span class="sf-toolbar-status sf-toolbar-status-yellow">No</span> |
51 |
| - </div> |
52 |
| - {% endif %} |
| 31 | + <div class="sf-toolbar-info-group"> |
| 32 | + {% if collector.enabled %} |
| 33 | + {% if collector.token %} |
| 34 | + <div class="sf-toolbar-info-piece"> |
| 35 | + <b>Logged in as</b> |
| 36 | + <span>{{ collector.user }}</span> |
| 37 | + </div> |
| 38 | + |
| 39 | + <div class="sf-toolbar-info-piece"> |
| 40 | + <b>Authenticated</b> |
| 41 | + <span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'yellow' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span> |
| 42 | + </div> |
| 43 | + |
| 44 | + <div class="sf-toolbar-info-piece"> |
| 45 | + <b>Token class</b> |
| 46 | + <span>{{ collector.tokenClass|abbr_class }}</span> |
| 47 | + </div> |
| 48 | + {% else %} |
| 49 | + <div class="sf-toolbar-info-piece"> |
| 50 | + <b>Authenticated</b> |
| 51 | + <span class="sf-toolbar-status sf-toolbar-status-yellow">No</span> |
| 52 | + </div> |
| 53 | + {% endif %} |
53 | 54 |
|
54 |
| - {% if collector.firewall %} |
55 |
| - <div class="sf-toolbar-info-piece"> |
56 |
| - <b>Firewall name</b> |
57 |
| - <span>{{ collector.firewall.name }}</span> |
58 |
| - </div> |
59 |
| - {% endif %} |
| 55 | + {% if collector.firewall %} |
| 56 | + <div class="sf-toolbar-info-piece"> |
| 57 | + <b>Firewall name</b> |
| 58 | + <span>{{ collector.firewall.name }}</span> |
| 59 | + </div> |
| 60 | + {% endif %} |
60 | 61 |
|
61 |
| - {% if collector.token and collector.logoutUrl %} |
| 62 | + {% if collector.token and collector.logoutUrl %} |
| 63 | + <div class="sf-toolbar-info-piece"> |
| 64 | + <b>Actions</b> |
| 65 | + <span> |
| 66 | + <a href="{{ collector.logoutUrl }}">Logout</a> |
| 67 | + {% if collector.impersonated and collector.impersonationExitPath %} |
| 68 | + | <a href="{{ collector.impersonationExitPath }}">Exit impersonation</a> |
| 69 | + {% endif %} |
| 70 | + </span> |
| 71 | + </div> |
| 72 | + {% endif %} |
| 73 | + {% else %} |
62 | 74 | <div class="sf-toolbar-info-piece">
|
63 |
| - <b>Actions</b> |
64 |
| - <span> |
65 |
| - <a href="{{ collector.logoutUrl }}">Logout</a> |
66 |
| - {% if collector.impersonated and collector.impersonationExitPath %} |
67 |
| - | <a href="{{ collector.impersonationExitPath }}">Exit impersonation</a> |
68 |
| - {% endif %} |
69 |
| - </span> |
| 75 | + <span>The security is disabled.</span> |
70 | 76 | </div>
|
71 | 77 | {% endif %}
|
72 |
| - {% else %} |
73 |
| - <div class="sf-toolbar-info-piece"> |
74 |
| - <span>The security is disabled.</span> |
75 |
| - </div> |
76 |
| - {% endif %} |
77 |
| - </div> |
78 |
| - {% endset %} |
| 78 | + </div> |
| 79 | + {% endset %} |
79 | 80 |
|
80 |
| - {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: color_code }) }} |
| 81 | + {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: color_code }) }} |
| 82 | + {% endif %} |
81 | 83 | {% endblock %}
|
82 | 84 |
|
83 | 85 | {% block menu %}
|
84 |
| - <span class="label {{ not collector.enabled or not collector.token ? 'disabled' }}"> |
| 86 | + <span class="label {{ not collector.firewall or not collector.token ? 'disabled' }}"> |
85 | 87 | <span class="icon">{{ include('@Security/Collector/icon.svg') }}</span>
|
86 | 88 | <strong>Security</strong>
|
87 | 89 | </span>
|
|
0 commit comments