From 0e65459ce21f9210535a7c5b50cb394d16ef1cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Thu, 23 Apr 2015 22:50:48 +0200 Subject: [PATCH] Add an input to switch user from the WDT Add a link to switch back --- .../Resources/views/Collector/security.html.twig | 11 +++++++++++ .../Resources/views/Profiler/toolbar.css.twig | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig index 61368928a21f3..36fb0b17c32c9 100644 --- a/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig +++ b/src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig @@ -24,6 +24,17 @@ {{ collector.tokenClass|abbr_class }} {% endif %} + {% if 'ROLE_PREVIOUS_ADMIN' in collector.roles %} +
+ Switch to user + Exit +
+ {% elseif 'ROLE_ALLOWED_TO_SWITCH' in collector.roles %} +
+ Switch to user + +
+ {% endif %} {% elseif collector.enabled %} You are not authenticated. {% else %} diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig index 109b4dd8cd8e3..cb0d869c1eaca 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig @@ -296,6 +296,11 @@ overflow-y: auto; } +.sf-toolbar-block input { + border: 1px solid #bbb; + padding: 0 4px; +} + .sf-toolbar-ajax-requests th, .sf-toolbar-ajax-requests td { border-bottom: 1px solid #ddd; padding: 0 4px;