mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
add optional impersonate feature (if firewall option switch_user is true)
This commit is contained in:
parent
c1b8de4ee5
commit
7bcb80be54
@ -50,3 +50,7 @@ Version 1.5.7
|
||||
- add css layout for boxes ;
|
||||
- collect supplementary query parameters in SearchController ;
|
||||
|
||||
Branch amli_impersonate
|
||||
=======================
|
||||
|
||||
- add optionnal impersonate feature (if firewall option switch_user is true) ;
|
||||
|
@ -219,4 +219,7 @@ Your administrator: Votre administrateur
|
||||
Recover your password: Regénération du mot de passe
|
||||
New password set: Le nouveau mot de passe est enregistré
|
||||
Your password has been set.: Votre mot de passe a été changé.
|
||||
Log in with your new password: Connectez-vous avec votre nouveau mot de passe
|
||||
Log in with your new password: Connectez-vous avec votre nouveau mot de passe
|
||||
|
||||
# impersonate
|
||||
Exit impersonation: Retour Administrateur
|
@ -19,22 +19,40 @@
|
||||
<li class="nav-link2 user-menu">
|
||||
<div class="li-content">
|
||||
<a href="javascript:void(0)" style="font-size: 0.8em; font-family: 'Open Sans'; font-weight:300;">
|
||||
|
||||
{{ 'Welcome' | trans }}<br/>
|
||||
<b>{{ app.user.username }}{{ render(controller('ChillMainBundle:UI:showNotificationUserCounter')) }}</b>
|
||||
|
||||
<b>{{ app.user.username }}{{ render(controller('ChillMainBundle:UI:showNotificationUserCounter')) }}</b>
|
||||
|
||||
{% if is_granted('ROLE_PREVIOUS_ADMIN') %}
|
||||
<i class="fa fa-wrench fa-lg" title="Impersonate mode"></i>
|
||||
{% endif %}
|
||||
|
||||
</a>
|
||||
</div>
|
||||
<ul class="submenu width-11-em user-menu-list" style="padding-left: 0; padding-right: 0; background-color:transparent;">
|
||||
{% for menu in menus %}
|
||||
<li style="display:block; background-color: #333333; padding-left:1.5em; border-bottom:1px; border-bottom: 1px solid #FFF;padding-top:0; padding-bottom:0;">
|
||||
<div style="margin-bottom:2px;">
|
||||
<div style="font-family: 'Open Sans'; font-weight:300; font-size: 0.75em; text-align:left; height: 46px; display:inline-block; width: calc(100% - 5em - 1px); vertical-align:top;">
|
||||
<div style="font-family: 'Open Sans'; font-weight:300; font-size: 0.75em; text-align:left; height: 46px; display:inline-block; width: calc(100% - 5em - 1px); vertical-align:top;">
|
||||
|
||||
{# Impersonate case logout #}
|
||||
{% if is_granted('ROLE_PREVIOUS_ADMIN') and menu.name == 'Logout' %}
|
||||
|
||||
<a href="{{ path('chill_main_homepage', {'_switch_user': '_exit'}) }}">
|
||||
{{ 'Exit impersonation'|trans }}
|
||||
</a>
|
||||
|
||||
{% else %}
|
||||
<a href="{{ menu.uri }}">{{ menu.label|trans }}</a>
|
||||
</div>
|
||||
<div style="background-color: #333333; text-align:center;width: 2em; margin-left:-0.15em; font-size:1.5em; color:#FFF; height: 46px; display:inline-block; vertical-align:top;float:right">{% spaceless %}
|
||||
{% if menu.extras.icon is defined %}
|
||||
<i class="fa fa-{{ menu.extras.icon }}"></i>
|
||||
{% endif %}
|
||||
{% endspaceless %}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div style="background-color: #333333; text-align:center;width: 2em; margin-left:-0.15em; font-size:1.5em; color:#FFF; height: 46px; display:inline-block; vertical-align:top;float:right">{% spaceless %}
|
||||
{% if menu.extras.icon is defined %}
|
||||
<i class="fa fa-{{ menu.extras.icon }}"></i>
|
||||
{% endif %}
|
||||
{% endspaceless %}</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
@ -27,6 +27,14 @@
|
||||
<li>
|
||||
<a href="{{ path('admin_user_edit_password', { 'id' : entity.id }) }}">{{ 'Edit password'|trans }}</a>
|
||||
</li>
|
||||
|
||||
{% if is_granted('ROLE_ALLOWED_TO_SWITCH') %}
|
||||
<li>
|
||||
<a href="{{ path('chill_main_homepage', {'_switch_user': entity.username }) }}">
|
||||
{{ 'Impersonate'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@ -34,11 +42,12 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('admin_user_new') }}">
|
||||
{{ 'Add a new user'|trans|capitalize }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{% endblock admin_content %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user