Silverstripe-masquerade - SilverStripe module to allow users to "masquerade" as other users

Overview

SilverStripe Masquerade Module

Build Status Scrutinizer Code Quality Code Coverage Build Status

About

This module is designed to allow an Administrator to "login" as another "Member" without changing their password or having to enter into other work-arounds. This can be useful for debugging, remote support and verifying bugs that others report.

Documentation

Please see the documentation

Installation

Installation is only supported via composer

$ composer require dhensby/silverstripe-masquerade

Contributing

Please see CONTRIBUTING.md for guidelines regarding testing and development instructions.

A change log is maintained in CHANGELOG.md

Reporting security issues

TBC

License

Please see LICENSE.md

Credits

Mask logo by Travis Beckham

3.1.x Compatibility fix by @axyr

Comments
  • SS4 Upgrade

    SS4 Upgrade

    Hi @dhensby, I'm going to be working on upgrading this module to SS4 and just wanted to run the namespacing by you. I was planning on DHensby\Masquerade at this point. I didn't see any namespacing in your other source repos.

    opened by muskie9 6
  • Improve testing

    Improve testing

    Hey @dhensby I've made some headway in getting at least one test to pass with SS 4...

    Not sure how best to test the controller - I think we need to trigger a request so the middleware applies, or maybe it's sufficient to test the middleware directly?

    Feel free to add to this PR or if you've got any advice so I can get it to pass its tests that'd be much appreciated

    opened by altwohill 3
  • module not working

    module not working

    Hi

    I installed this module, but when I click on "Masqu...." it just logged me out, but I did not get logged in.

    This is what I see if I open the link in new tab:

    image

    Here is what we installed:

    a2nt/silverstripe-treemultiselect-sortable-field dev-main 562f132   Sortable tree multiselect field
    bramus/ansi-php                                  3.1                ANSI Control Functions and ANSI Control Sequences (Colors, Erasing, etc.) for PHP CLI Apps
    bramus/monolog-colored-line-formatter            2.0.3              Colored Line Formatter for Monolog
    bummzack/sortablefile                            2.1.3              An extension for SilverStripe 4 that adds sorting to UploadField.
    composer/ca-bundle                               1.3.1              Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
    composer/installers                              v1.12.0            A multi-framework Composer library installer
    composer/semver                                  3.3.2              Semver library that offers utilities, version constraint parsing and validation.
    dhensby/silverstripe-masquerade                  dev-master 642f695 SilverStripe module to allow you to masquerade as other users
    dnadesign/silverstripe-elemental                 4.x-dev 3fe3c41    Elemental pagetype and collection of Elements
    doctrine/instantiator                            1.4.1              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
    doctrine/lexer                                   1.2.3              PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
    egulias/email-validator                          3.1.2              A library for validating emails against several RFCs
    embed/embed                                      v4.4.3             PHP library to retrieve page info using oembed, opengraph, etc
    evanshunt/lumberjack-sort-and-summary            dev-master a91ebe8 Uses $summary_fields, $default_sort, and $plural_name for LumberJack when only one class is allowed for children
    fakerphp/faker                                   v1.19.0            Faker is a PHP library that generates fake data for you.
    guzzlehttp/guzzle                                7.4.2              Guzzle is a PHP HTTP client library
    guzzlehttp/promises                              1.5.1              Guzzle promises library
    guzzlehttp/psr7                                  2.2.1              PSR-7 message implementation that also provides common utility methods
    intervention/image                               2.7.1              Image handling and manipulation library with support for Laravel integration
    league/csv                                       9.8.0              CSV data manipulation made easy in PHP
    league/flysystem                                 1.1.9              Filesystem abstraction: Many filesystems, one API.
    league/mime-type-detection                       1.9.0              Mime-type detection for Flysystem
    lodash-php/lodash-php                            0.0.7              A port of Lodash to PHP
    m1/env                                           2.2.0              Env is a lightweight library bringing .env file parser compatibility to PHP. In short - it enables you to read .env files with PHP.
    marcj/topsort                                    2.0.0              High-Performance TopSort/Dependency resolving algorithm
    ml/iri                                           1.1.4              IRI handling for PHP
    ml/json-ld                                       1.2.0              JSON-LD Processor for PHP
    monolog/monolog                                  1.27.0             Sends your logs to files, sockets, inboxes, databases and various web services
    myclabs/deep-copy                                1.11.0             Create deep copies (clones) of your objects
    nikic/php-parser                                 v4.13.2            A PHP parser written in PHP
    oscarotero/html-parser                           v0.1.6             Parse html strings to DOMDocument
    phpdocumentor/reflection-common                  2.2.0              Common reflection classes used by phpdocumentor to reflect the code structure
    phpdocumentor/reflection-docblock                5.3.0              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a D...
    phpdocumentor/type-resolver                      1.6.1              A PSR-5 based resolver of Class names, Types and Structural Element Names
    phpspec/prophecy                                 v1.10.3            Highly opinionated mocking framework for PHP 5.3+
    phpunit/php-code-coverage                        4.0.8              Library that provides collection, processing, and rendering functionality for PHP code coverage information.
    phpunit/php-file-iterator                        1.4.5              FilterIterator implementation that filters files based on a list of suffixes.
    phpunit/php-text-template                        1.2.1              Simple template engine.
    phpunit/php-timer                                1.0.9              Utility class for timing
    phpunit/php-token-stream                         2.0.2              Wrapper around PHP's tokenizer extension.
    phpunit/phpunit                                  5.7.27             The PHP Unit Testing framework.
    psr/cache                                        1.0.1              Common interface for caching libraries
    psr/container                                    1.1.2              Common Container Interface (PHP FIG PSR-11)
    psr/event-dispatcher                             1.0.0              Standard interfaces for event handling.
    psr/http-client                                  1.0.1              Common interface for HTTP clients
    psr/http-factory                                 1.0.1              Common interfaces for PSR-7 HTTP message factories
    psr/http-message                                 1.0.1              Common interface for HTTP messages
    psr/log                                          1.1.4              Common interface for logging libraries
    psr/simple-cache                                 1.0.1              Common interfaces for simple caching
    ralouphie/getallheaders                          3.0.3              A polyfill for getallheaders.
    sebastian/code-unit-reverse-lookup               1.0.2              Looks up which function or method a line of code belongs to
    sebastian/comparator                             1.2.4              Provides the functionality to compare PHP values for equality
    sebastian/diff                                   1.4.3              Diff implementation
    sebastian/environment                            2.0.0              Provides functionality to handle HHVM/PHP environments
    sebastian/exporter                               2.0.0              Provides the functionality to export PHP variables for visualization
    sebastian/global-state                           1.1.1              Snapshotting of global state
    sebastian/object-enumerator                      2.0.1              Traverses array structures and object graphs to enumerate all referenced objects
    sebastian/recursion-context                      2.0.0              Provides functionality to recursively process PHP variables
    sebastian/resource-operations                    1.0.0              Provides a list of PHP built-in functions that operate on resources
    sebastian/version                                2.0.1              Library that helps with managing the version number of Git-hosted PHP projects
    sendgrid/php-http-client                         3.14.4             HTTP REST client, simplified for PHP
    sendgrid/sendgrid                                7.11.5             This library allows you to quickly and easily send emails through Twilio SendGrid using PHP.
    silverstripe/admin                               1.x-dev 1149716    SilverStripe admin interface
    silverstripe/asset-admin                         1.x-dev d3c58c7    Asset management for the SilverStripe CMS
    silverstripe/assets                              1.x-dev a850ecc    SilverStripe Assets component
    silverstripe/campaign-admin                      1.x-dev 419f673    SilverStripe campaign admin interface
    silverstripe/cms                                 4.x-dev cc43326    The SilverStripe Content Management System
    silverstripe/config                              1.x-dev 03c65b1    SilverStripe configuration based on YAML and class statics
    silverstripe/errorpage                           1.x-dev 3f798ff    ErrorPage component for SilverStripe CMS
    silverstripe/event-dispatcher                    0.1.3              Publish and subscribe to events in Silverstripe CMS or your Silverstripe application
    silverstripe/framework                           4.x-dev 3e5a74c    The SilverStripe framework
    silverstripe/graphql                             dev-master e24dd87 GraphQL server for SilverStripe models and other data
    silverstripe/graphql-devtools                    dev-master a71a48f Tools to help developers building new applications on SilverStripe’s GraphQL API
    silverstripe/login-forms                         4.6.0              A collection of templates for the CMS login screens
    silverstripe/lumberjack                          2.1.1              A module to make managing pages in a GridField easy without losing any of the functionality that you're used to in the CMS.
    silverstripe/mimevalidator                       2.x-dev f35e03d    Checks uploaded file content roughly matches a known MIME type for the file extension.
    silverstripe/recipe-cms                          4.x-dev 4074285    SilverStripe recipe for fully featured page and asset content editing
    silverstripe/recipe-core                         4.x-dev 9b24695    SilverStripe framework-only core recipe
    silverstripe/recipe-plugin                       1.6.0              Helper plugin to install SilverStripe recipes
    silverstripe/reports                             4.x-dev 6d56502    Reports module for SilverStripe CMS
    silverstripe/segment-field                       2.5.0              A reusable approach to segment-generating fields
    silverstripe/session-manager                     1.x-dev b6623a6    Allow users to manage and revoke access to multiple login sessions across devices.
    silverstripe/siteconfig                          4.x-dev 2eafd50    Site wide settings administration.
    silverstripe/spamprotection                      3.2.1              Spam protection module for SilverStripe.
    silverstripe/userforms                           5.12.0             UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code
    silverstripe/vendor-plugin                       1.5.2              Allows vendor modules to expose directories to the webroot
    silverstripe/versioned                           1.x-dev fab7143    SilverStripe Versioned component
    silverstripe/versioned-admin                     1.x-dev 6dee846    SilverStripe versioned admin interface
    sminnee/callbacklist                             0.1.1              PHP class that manages a list of callbacks
    sminnee/phpunit-mock-objects                     3.4.10             Mock Object library for PHPUnit (fork to add PHP 7.4 support to 3.4)
    starkbank/ecdsa                                  0.0.5              fast openSSL-compatible implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA)
    sunnysideup/cleaner_tinymce_config               dev-master 3907168 Provides an easier and cleaner way to configure your TinyMCE manager. By default, you will also be provided with a simplified TinyMCE editor.
    sunnysideup/cms-niceties                         dev-master 1aa6129 adds a bit of formatting and a few CMS Field tricks to the CMS
    sunnysideup/cms_edit_link_field                  dev-master ad195ba Adds EDIT IN CMS link to any object within the Silverstripe CMS
    sunnysideup/collect-elemental-content            dev-master 774b4cb Collect all the content from the elemental blocks for easy searching.
    sunnysideup/dataobjectsorter                     dev-master e0d214b Silverstripe module with crud functionality: edit one field for one record, edit one record, edit one field for all records AND sort recor...
    sunnysideup/delete-all-tables                    dev-master a84eae9 Silverstripe module to delete all tables - CAREFUL!
    sunnysideup/elemental-can-view                   dev-master 5d68d7f Helps CMS Users navigate through tabs in Elemental CMS Interface by providing clickable links to switch tabs.
    sunnysideup/elemental-switch-tabs                dev-master 8085dc9 Helps CMS Users navigate through tabs in Elemental CMS Interface by providing clickable links to switch tabs.
    sunnysideup/email_address_database_field         dev-master 4dfd2d4 E-mail address database field for the Silverstripe CMS
    sunnysideup/error-log-made-easy                  dev-master 005b863 Set up error logging on your silverstripe website: emails every error to a designated email.
    sunnysideup/flush                                dev-master 28281e1 DB::alteration_message on steroids.
    sunnysideup/fulltext-search-engine-simple        dev-master d29b213 Basic fulltext search similar to the Silverstripe Core FullText Search Engine but standalone API.
    sunnysideup/internal-external-link               dev-master 99aa3f9 Allows the addition of a link that can be internal or external
    sunnysideup/metatags                             dev-master 1d66917 simplify your metatags - a ton of tools to increase SEO visibility, including file name adjustments
    sunnysideup/perfect_cms_images                   dev-master 79d01e2 Silverstripe Module that makes it easier for CMS Editors to upload the right size image. It allows the developer to set the size for each ...
    sunnysideup/phone_field                          dev-master 7673e5c Silverstripe Module that adds a phone field to your database field options, such as Varchar and HTMLText
    sunnysideup/prettyphoto                          2.0.4              adds 'pretty photo' - a jQuery library to your Silverstripe application 
    sunnysideup/sanitise-class-name                  dev-master f03fd40 Sanitises a classname to hyphens and back to backslashes
    sunnysideup/search_simple_smart                  dev-master 2738d4c Silverstripe Module that allows you to set up complex search algorythms in an easyway
    sunnysideup/share_this_simple                    dev-master fd199c4 Silverstripe Module that provides a simple way to add share this links to your website.
    sunnysideup/silverstripe-sendgrid-mailer         dev-master c56a607 A drop-in mailer replacement for SendGrid
    sunnysideup/site-wide-search                     dev-master 2c7632f Search your entire silverstripe site!
    sunnysideup/templateoverview                     dev-master 0a3fa62 adds development tools for building silverstripe websites, in particular around managing page types.
    sunnysideup/test-email                           dev-master 1e00683 Test that the basic email is working.
    sunnysideup/vardump                              dev-master aab5d4a Dev Module for intelligent Debugging
    sunnysideup/yes-no-any-filter                    dev-master 26709c0 Fix for broken boolean search in Silverstripe ORM
    swiftmailer/swiftmailer                          v6.3.0             Swiftmailer, free feature-rich PHP mailer
    symbiote/silverstripe-gridfieldextensions        3.3.0              A collection of useful grid field components
    symbiote/silverstripe-grouped-cms-menu           4.0.1              Allows you to group CMS menu items.
    symfony/cache                                    v4.4.40            Provides an extended PSR-6, PSR-16 (and tags) implementation
    symfony/cache-contracts                          v2.5.1             Generic abstractions related to caching
    symfony/config                                   v4.4.37            Helps you find, load, combine, autofill and validate configuration values of any kind
    symfony/deprecation-contracts                    v2.5.1             A generic function and convention to trigger deprecation notices
    symfony/event-dispatcher                         v5.4.3             Provides tools that allow your application components to communicate with each other by dispatching events and listening to them
    symfony/event-dispatcher-contracts               v2.5.1             Generic abstractions related to dispatching event
    symfony/filesystem                               v5.4.7             Provides basic utilities for the filesystem
    symfony/finder                                   v4.4.37            Finds files and directories via an intuitive fluent interface
    symfony/polyfill-ctype                           v1.25.0            Symfony polyfill for ctype functions
    symfony/polyfill-iconv                           v1.25.0            Symfony polyfill for the Iconv extension
    symfony/polyfill-intl-grapheme                   v1.25.0            Symfony polyfill for intl's grapheme_* functions
    symfony/polyfill-intl-idn                        v1.25.0            Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
    symfony/polyfill-intl-normalizer                 v1.25.0            Symfony polyfill for intl's Normalizer class and related functions
    symfony/polyfill-mbstring                        v1.25.0            Symfony polyfill for the Mbstring extension
    symfony/polyfill-php72                           v1.25.0            Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
    symfony/polyfill-php73                           v1.25.0            Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions
    symfony/polyfill-php80                           v1.25.0            Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions
    symfony/polyfill-php81                           v1.25.0            Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions
    symfony/property-access                          v5.4.7             Provides functions to read and write from/to an object or array using a simple string notation
    symfony/property-info                            v5.4.7             Extracts information about PHP class' properties using metadata of popular sources
    symfony/service-contracts                        v2.5.1             Generic abstractions related to writing services
    symfony/string                                   v5.4.3             Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way
    symfony/translation                              v4.4.37            Provides tools to internationalize your application
    symfony/translation-contracts                    v2.5.1             Generic abstractions related to translation
    symfony/var-exporter                             v5.4.7             Allows exporting any serializable PHP data structure to plain PHP code
    symfony/yaml                                     v4.4.37            Loads and dumps YAML files
    tractorcow/silverstripe-colorpicker              4.1.0              Color picker field for Silverstripe CMS using the ColorPicker jQuery plugin
    ua-parser/uap-php                                v3.9.14            A multi-language port of Browserscope's user agent parser.
    undefinedoffset/silverstripe-nocaptcha           2.3.0              A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation
    undefinedoffset/sortablegridfield                2.0.9              Adds drag and drop functionality to SilverStripe 4.x's GridField
    voku/portable-ascii                              1.5.6              Portable ASCII library - performance optimized (ascii) string functions for php.
    voku/portable-utf8                               5.4.51             Portable UTF-8 library - performance optimized (unicode) string functions for php.
    wamania/php-stemmer                              v2.2.0             Native PHP Stemmer
    webmozart/assert                                 1.10.0             Assertions to validate method input/output with nice error messages.
    webonyx/graphql-php                              v14.11.5           A PHP port of GraphQL reference implementation
    wilr/silverstripe-googlesitemaps                 2.2.1              SilverStripe support for the Google Sitemaps XML, enabling Google and other search engines to see all urls on your site. This helps your S...
    
    opened by sunnysideup 2
  • GridFieldDetailForm_ItemRequest::getRecord(); does not exists 3.1.13

    GridFieldDetailForm_ItemRequest::getRecord(); does not exists 3.1.13

    The composer file accepts SS ^3.1.0, but this does not work...

    GridFieldDetailForm_ItemRequest::getRecord(); is not present in SS 3.1.13.

    changing MasqueradeGridFieldDetailForm_ItemRequest line 11:

    $member = $this->getRecord();

    to

    $member = $this->record;

    makes it work....

    opened by ghost 1
  • Idea: better way to set member

    Idea: better way to set member

    This

    https://github.com/dhensby/silverstripe-masquerade/blob/master/src/Control/MasqueradeMiddleware.php#L15-L20

    Seems to be running on every request - do I see that right?

    I wonder - if it would be better to ...

    a. only run this on a specific URL, or in any way, run a super fast check - does this apply now. e.g. isset($_GET[....]) before running other logic. It may not make much difference, but right now you are dependent on the session being super fast and that is not really in your control.

    b. check if the current user is allowed to "canMasquerade", otherwise, anyone who can hack the session variables has access to any user

    c. in that light - would it be better if the user is identified with a secret code rather than just an ID

    opened by sunnysideup 1
Releases(v0.2.2)
Owner
Daniel Hensby
Freelance Solutions Architect, open source advocate, and core contributor for @silverstripe, maintainer of node-mssql
Daniel Hensby
A SilverStripe module for conveniently injecting JSON-LD metadata into the header of each rendered page in SilverStripe

A SilverStripe module for conveniently injecting JSON-LD metadata into the header of each rendered page in Silver

null 4 Apr 20, 2022
Silverstripe-fulltextsearch - Adds external full text search engine support to SilverStripe

FullTextSearch module Adds support for fulltext search engines like Sphinx and Solr to SilverStripe CMS. Compatible with PHP 7.2 Important notes when

Silverstripe CMS 42 Dec 30, 2022
Silverstripe-searchable - Adds to the default Silverstripe search by adding a custom results controller and allowing properly adding custom data objects and custom fields for searching

SilverStripe Searchable Module UPDATE - Full Text Search This module now uses Full Text Support for MySQL/MariaDB databases in version 3.* Adds more c

ilateral 13 Apr 14, 2022
❄️ Magento 2 Snowflake module allow you to add snow and even more on your site and make winter fun.

❄️ Magento 2 Snowflake module allow you to add snow and even more on your site and make winter fun.

OpenGento 6 Apr 30, 2022
Allow your users to login with their Ethereum wallet.

Allow your users to login with their Ethereum wallet Allow your users to link their Ethereum wallet to their account to skip entering their login cred

Miguel Piedrafita 84 Nov 7, 2022
SilverStripe Garbage Collection Module

SilverStripe Module for defining and processing Garbage Collection on SilverStripe Applications.

Brett Tasker 8 Aug 12, 2022
This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every translatable field.

Autotranslate This module integrates Silverstripe CMS with Google Translate API and then allows content editors to use automatic translation for every

null 4 Jan 3, 2022
Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance

Silverstripe Sendy Silverstripe module allowing editors to create newsletters using elemental blocks and export them to a sendy instance. Introduction

Syntro Opensource 4 Apr 20, 2022
Alerts users in the SilverStripe CMS when multiple people are editing the same page.

Multi-User Editing Alert Alerts users in the SilverStripe CMS when multiple people are editing the same page. Maintainer Contact Julian Seidenberg <ju

Silverstripe CMS 15 Dec 17, 2021
Magento 2 Debug Helper Module for easy debugging with Xdebug and PHPStorm or any other IDE

Magento 2 Debug Helper Information and Usage Magento 2 Debug Helper Module usage with PHPStorm and Xdebug Installation To install the Magento 2 Debug

Dmitry Shkoliar 13 May 24, 2022
Magento 2 Module Experius Page Not Found 404. This module saves all 404 url to a database table

Magento 2 Module Experius Page Not Found 404 This module saves all 404 urls to a database table. Adds an admin grid with 404s It includes a count so y

Experius 28 Dec 9, 2022
Allow multiple options for Magento 2 checkout layout. Provides capabilities to AB test checkout changes and more.

Aimes_CheckoutDesigns Features Please note: This module is currently still considered a proof of concept. This module provides the ability to change c

Rob Aimes 30 Aug 8, 2022
Formcreator is a plugin which allow creation of custom forms of easy access

Formcreator is a plugin which allow creation of custom forms of easy access. At the same time, the plugin allow the creation of one or more tickets when the form is filled.

GLPI plugins 135 Dec 22, 2022
Methods to allow the mapping of cases to snake / camel for input / output

Methods to allow the mapping of cases to snake / camel for input / output This is where your description should go. Limit it to a paragraph or two. Co

Craig Smith 4 Aug 31, 2022
Allow players to see how well they are doing while pvping with the help of a combo counter

Combo-Counter Allow players to see how well they are doing while pvping with the help of a combo counter Settngs / Config #set to false if you dont wa

null 3 Jun 1, 2022
This plugin allow you play music from resources pack in minecraft

Music Player for PocketMine-MP Commands music-start songname music-stop songname IMPORTANT! You must add music resources pack to PocketMine resources

Excalibur 1 Oct 14, 2021
Provide blocks which allow positioning content within them in layouts.

Mini layouts Provide blocks which allow positioning content within them in layouts. Backdrop Installation Install and enable the module as usual. Go t

Backdrop CMS contributed projects 5 Dec 17, 2021
Allow SVG images to be used in Magento CMS blocks and pages via the TinyMCE Wysiwyg Editor.

Hyvä Themes - SVG support for the Magento CMS Wysiwyg Editor Allow SVG images to be used in CMS blocks and pages via the TinyMCE Wysiwyg Editor. hyva-

Hyvä 14 Dec 15, 2022
Enhancement to Magento to allow simple product prices to be used instead of the default special-case configurable product prices

Simple Configurable Products Extension For Magento This documentation applies to SCP versions 0.7 onwards. The documentation for SCP v0.6 and earlier

Simon King 288 Nov 7, 2022