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