Allows Admins to quickly login as any user in the system during development/testing

Overview

SilverStripe User Switcher

The module adds a small form both in the frontend to quickly login as any user in the system. The intended use is in testing environments, to assist in the testing of SilverStripe applications that would otherwise require multiple browsers open with users of various roles and permissions logged in.

User Switching is only available to ADMIN users and only when running in dev or test mode.

Screenshot

Screenshot

Requirements

  • SilverStripe ^4.0

Integration with Better Navigator

If you have installed the Better Navigator module (recommended), the userwitcher dropdown field will be placed in the Better Navigator tools container instead of the bottom of the page. https://github.com/jonom/silverstripe-betternavigator

NOTE: currently you will need to copy userswitcher/templates/BetterNavigator to either your theme dir or project dir for this to work.

Disable default jQuery

If using this on the frontend, you can disable jQuery like so:

Requirements::block(THIRDPARTY_DIR . '/jquery/jquery.js');

Install

$ composer require sheadawson/silverstripe-userswitcher

Once the module files are in your project, login as and ADMIN user and run ?flush=all

TODO

Get working in SilverStripe 4 CMS. Currently only upgraded for frontend use.

Comments
  • Tagged release

    Tagged release

    Hey Shea,

    First off, sweet module - makes administration functionality a lot easier to implement and test over multiple users. Would you be able to tag a release for the latest master branch, the other tags are a bit stale.

    opened by stevie-mayhew 2
  • Enhancement: Integrate with BetterNavigator

    Enhancement: Integrate with BetterNavigator

    It would be great if UserSwitcher could be placed inside BetterNavigator which resides on the top right of the page.

    I don't know if it's currently possible to add fields or HTML to BetterNavigator, maybe it'd need to be changed to get this working.

    See https://github.com/jonom/silverstripe-betternavigator

    opened by wernerkrauss 1
  • fix(UserSwitcher): Stop most of the logic from using entwine

    fix(UserSwitcher): Stop most of the logic from using entwine

    fix(UserSwitcher): Stop most of the logic from using entwine.

    This fixes https://github.com/sheadawson/silverstripe-userswitcher/issues/11.

    I honestly don't know what entwine is doing, but it seemed to be buggy when the $.get function block was in the scope of the $.entwine() function.

    In any case, this should retain the expected behaviour, but not bug things out.

    opened by silbinarywolf 1
  • fix(this._super): Add this._super calls to avoid weird JS breaking behaviour

    fix(this._super): Add this._super calls to avoid weird JS breaking behaviour

    fix(this._super): Add this._super calls to avoid weird JS breaking behaviour.

    I didn't hit any specific issues recently, but I recall trying to use this module on a previous project and it caused things to be broken, so my assumption is that it's the missing this._super() calls.

    opened by silbinarywolf 1
  • Disable on dev/build

    Disable on dev/build

    When running dev/build on 3.1.15 and changing something on Member i get an error like:

    [User Error] Couldn't run query: SELECT DISTINCT "Member"."ClassName", .... FROM "Member" WHERE ("Member"."ID" = 123) ORDER BY "Member"."Surname" ASC, "Member"."FirstName" ASC LIMIT 1 Unknown column 'Member.Foo' in 'field list'

    Disabling userswitcher by putting a _manifest_exclude file in fixes this problem by now but isn't that comfortable...

    opened by wernerkrauss 1
  • fix(dev/build): Ignore onAfterInit logic inside dev/build, Move various copy-pastes of

    fix(dev/build): Ignore onAfterInit logic inside dev/build, Move various copy-pastes of "Permission::check('ADMIN') || Session::get('UserSwitcher')" logic into one service class UserSwitcher.

    fix(dev/build): Ignore onAfterInit logic inside dev/build, Move various copy-pastes of "Permission::check('ADMIN') || Session::get('UserSwitcher')" logic into one service class UserSwitcher.

    opened by silbinarywolf 0
  • fix(jQuery): Fixes case where you Requirements::block() jquery.js in your Page::init(), but it's not respected due to UserSwitcherControllerExtension::onAfterInit providing jquery.js on-the-fly via jquery.ondemand.

    fix(jQuery): Fixes case where you Requirements::block() jquery.js in your Page::init(), but it's not respected due to UserSwitcherControllerExtension::onAfterInit providing jquery.js on-the-fly via jquery.ondemand.

    fix(jQuery): Fixes case where you Requirements::block() jquery.js in your Page::init(), but it's not respected due to UserSwitcherControllerExtension::onAfterInit providing jquery.js on-the-fly via jquery.ondemand.

    This is what would have been causing quirks on the frontend for most users I'd say. They were rolling their own jQuery and jquery.ondemand was hosing everything.

    opened by silbinarywolf 0
  • Entwine causing weirdness

    Entwine causing weirdness

    I believe it has something to do with the $('body').entwine() functionality, but it seems to be stopping behaviour from executing when I dynamically AJAX elements in on the frontend.

    To avoid quirks causing timesinks, I think I'll avoid this module until the entwine() functions don't mess with core functionality in unpredictable/odd ways.

    opened by silbinarywolf 0
  • Added standard Scrutinizer config

    Added standard Scrutinizer config

    Hello!

    I'm helpful robot. I noticed you don't have a Scrutinizer config file. This one adds many code quality checks. If you are unsure of how to connect your repository to Scrutinizer, read the guide I wrote for you humans.

    Have a nice day! [brrrrb, click]

    opened by helpfulrobot 0
  • Added standard .gitattributes file

    Added standard .gitattributes file

    Hello!

    I'm helpful robot. I noticed you don't have a git attributes file. You were forcing my brother and sister robots to download files you were never going to use anyway. I hope you feel better ignoring those files...

    Have a nice day! [pirrrrrlk]

    opened by helpfulrobot 0
Releases(1.0.2)
Owner
LiveSource
LiveSource
A Magento 2 module that allows admins to duplicate CMS blocks and pages from their respective grids and en masse.

element119 | CMS Duplicator ?? Features ✔️ Allows merchants to duplicate CMS blocks and pages from the Action column in the admin grid ✔️ Allows merch

Kiel Pykett 13 Oct 13, 2022
Login as a different user quickly

Lara Personate Is a user impersonate for the Laravel framework. This package makes it easier for users who have access rights such as super admin to t

Octopy ID 172 Dec 2, 2022
Allow any Discord user to sign in to your website and save their discord user information for later use.

Simple Discord SSO ( Single Sign-On ) Requires at least: 5.0 Tested up to: 5.8.3 Stable tag: 1.0.2 Requires PHP: 7.4 License: GPLv2 or later License U

null 2 Oct 7, 2022
This repository contains academic codes from experiments and labs I did during my academic years.

Table Of Content Semester 3 Business Communication Skills Computer Graphics Digital Electronics and Logic Design Fundamentals of Data Structures Human

Pratik Pingale 13 Nov 29, 2022
run user analytics within your system and track user data inside your database.

WP Local Analytics plugin. run user analytics within your system and track user data inside your database. Installing Go to the plugin page from the W

Gary 5 Dec 21, 2022
WP Local Analytics plugin. - run user analytics within your system and track user data inside your database.

WP Local Analytics plugin. - run user analytics within your system and track user data inside your database.

Gary 5 Dec 21, 2022
🧬 Nano is a zero-config, no skeleton, minimal Hyperf distribution that allows you to quickly build a Hyperf application with just a single PHP file.

Nano is a zero-config, no skeleton, minimal Hyperf distribution that allows you to quickly build a Hyperf application with just a single PHP file.

Hyperf 273 Jan 4, 2023
Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pages from the admin panel.

Magento 2 Preview/Visit Catalog Overview Magento 2 Preview/Visit Catalog allows the store owner to quickly preview the catalog (product & category) pa

Raj KB 4 Sep 27, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
Osclass Enterprise allows you to quickly build your own classifieds site for free.

Osclass Enterprise Osclass Enterprise is a fork of the Osclass v3.8.0 repository, containing many fixes and improvements (check the CHANGELOG). Releas

null 6 Dec 20, 2022
Basic User login & signup in php with JavaScript form validations

User login & signup in php User login & signup in PHP-MySQL with JavaScript form validations Project Details : Project Name : User Registration & Logi

Swapnil Zambare 2 Sep 30, 2022
Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.

Admidio Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it

Admidio 212 Dec 30, 2022
salah eddine bendyab 18 Aug 17, 2021
Track any ip address with IP-Tracer. IP-Tracer is developed for Linux and Termux. you can retrieve any ip address information using IP-Tracer.

IP-Tracer is used to track an ip address. IP-Tracer is developed for Termux and Linux based systems. you can easily retrieve ip address information using IP-Tracer. IP-Tracer use ip-api to track ip address.

Rajkumar Dusad 1.2k Jan 4, 2023
The VarExporter component allows exporting any serializable PHP data structure to plain PHP code.

The VarExporter component allows exporting any serializable PHP data structure to plain PHP code. While doing so, it preserves all the semantics associated with the serialization mechanism of PHP (__wakeup, __sleep, Serializable).

Symfony 1.8k Jan 1, 2023
This repository contains the code for the front end/UI of the login system

Bug-free-login This repository contains the code for the front end/UI of the login system Requirements PHP 5.5.0 or higher. How to use Download ZIP wi

Abhijeet Kumar 2 Oct 6, 2022
Helps detect the user's browser and platform at the PHP level via the user agent

cbschuld/browser.php Helps detect the user's browser and platform at the PHP level via the user agent Installation You can add this library as a local

Chris Schuld 574 Dec 16, 2022
OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities required for any enterprise.

OrangeHRM Open Source Application OrangeHRM is a comprehensive Human Resource Management (HRM) System that captures all the essential functionalities

OrangeHRM 452 Jan 4, 2023