Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
{{ collector.tokenClass|abbr_class }}
</div>
{% endif %}
{% if 'ROLE_PREVIOUS_ADMIN' in collector.roles %}
<div class="sf-toolbar-info-piece">
<b>Switch to user</b>
<a href="?_switch_user=_exit" title="Switch back">Exit</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the current url allow only POST method ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact. What about using an AJAX request to a special URL ?

</div>
{% elseif 'ROLE_ALLOWED_TO_SWITCH' in collector.roles %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't work when the role is modified

# app/config/security.yml
security:
    firewalls:
        main:
            switch_user: { role: ROLE_ADMIN }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact. Added to the todo list. That goes with the customization of the request parameter.

<form class="sf-toolbar-info-piece">
<b>Switch to user</b>
<input name="_switch_user" placeholder="username" required="required" size="15"/>
</form>
{% endif %}
{% elseif collector.enabled %}
You are not authenticated.
{% else %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down