Skip to content

Commit 3485b36

Browse files
committed
Logged in + protect double switch
1 parent f58788d commit 3485b36

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Resources/views/base.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ desired effect
176176
} %}
177177

178178
<p>
179-
{{ 'layout.logged_in_as'|trans({'%username%': app.user.username}) }}
179+
{{ 'Logged in as'|trans({'%username%': app.user.username}) }}
180180
<small>Member since {{ app.user.created|date(date_time_format) }}</small>
181181
<small>
182182
{% for role in app.user.roles %}

Resources/views/user/index.html.twig

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@
7171
'icon': 'pencil'
7272
}%}
7373
{% if user.enabled %}
74-
{% include 'EMSCoreBundle:elements:get-button.html.twig' with {
75-
'url': path('homepage', {'_switch_user': user.username}),
76-
'label': 'Switch user',
77-
'icon': 'refresh'
78-
}%}
74+
{% if not is_granted('ROLE_PREVIOUS_ADMIN') %}
75+
{% include 'EMSCoreBundle:elements:get-button.html.twig' with {
76+
'url': path('homepage', {'_switch_user': user.username}),
77+
'label': 'Switch user',
78+
'icon': 'refresh'
79+
}%}
80+
{% endif %}
7981
{% if not is_granted('ROLE_PREVIOUS_ADMIN') %}
8082
{% include 'EMSCoreBundle:elements:post-button.html.twig' with {
8183
'url': path('user.enabling', {'id': user.id}),

0 commit comments

Comments
 (0)