Helps you detect if a user is being impersonated and get the originally signed-in user.
This plugin requires Craft CMS 3.6.0 or later (might work with earlier 3.x versions, but I didn't test it, and you'll need to tweak the composer.json).
Starting with version 2.0.0, this plugin requires Craft 4.0.0 or later.
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project
-
Then tell Composer to load the plugin:
composer require nstcactus/craft-bas-les-masques
-
In the Control Panel, go to Settings → Plugins and click the “Install” button for Bas les masques !.
Return a boolean indicating if there is an ongoing impersonation.
Return the User
element corresponding
to the original user (the one impersonating the other), or null
if there is no
ongoing impersonation.
{% if craft.basLesMasques.isImpersonating() %}
{{ craft.basLesMasques.getOriginalUser() }}
{% endif %}
Return a boolean indicating if there is an ongoing impersonation.
Return the User
element corresponding
to the original user (the one impersonating the other), or null
if there is no
ongoing impersonation.
Bas les masques! is french for "Drop the act!" or "Stop pretending to be someone else".
Brought to you by nstCactus