定制 nstcactus/craft-bas-les-masques 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nstcactus/craft-bas-les-masques

Composer 安装命令:

composer require nstcactus/craft-bas-les-masques

包简介

Helps you detect if a user is being impersonated and get the originally signed in user

README 文档

README

Helps you detect if a user is being impersonated and get the originally signed-in user.

Requirements

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.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require nstcactus/craft-bas-les-masques
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Bas les masques !.

Usage

From the twig templates

craft.basLesMasques.isImpersonating()

Return a boolean indicating if there is an ongoing impersonation.

craft.basLesMasques.getOriginalUser()

Return the User element corresponding to the original user (the one impersonating the other), or null if there is no ongoing impersonation.

Example

    {% if craft.basLesMasques.isImpersonating() %}
        {{ craft.basLesMasques.getOriginalUser() }}
    {% endif %}

From PHP code

\nstcactus\baslesmasques\Plugin::getInstance()->service->isImpersonating()

Return a boolean indicating if there is an ongoing impersonation.

\nstcactus\baslesmasques\Plugin::getInstance()->service->getOriginalUser()

Return the User element corresponding to the original user (the one impersonating the other), or null if there is no ongoing impersonation.

What's with the strange name?

Bas les masques! is french for "Drop the act!" or "Stop pretending to be someone else".

Brought to you by nstCactus

统计信息

  • 总下载量: 226
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-09-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固