Yii 1.1: lightning-swap-user

Change the user in a single click

lightning Swap User

Progect on GitHub

Russian version readme

Change the user in a single click, for Yii Framework.

Usage: ΒΆ

  1. Copy the repository.
  2. Unzip to protected folder.
  3. In layout/main.php or on dashboard admin use code, which is implemented on.
  4. Pass authentication.
        'modelNameUser' => 'User', //Name User model,
        'fieldNameUser' => 'username', //Name field login
        'fieldIdUser' => 'id', //Name field ID
        'ipWhiteList' => array(), // List of ip addresses that are available widget.
        'typeView' => 'dropDown' // Type of widget - 'autoComplete' or 'dropDown' 
// ipWhiteList - default array('', '::1/128') - localhost. These ip addresses will be added to your.

or one line

<?php $this->widget('Masked'); ?>

Note: Restrict access to this widget only necessary users.

UPD: v0.3 Add filter access by IP adress and theme view widget.

Progect on GitHub

Total 3 comments

#12798 report it
YiiJeka at 2013/04/12 06:27am
Incorrect access control

@Trejder U true. I was hoping to do a single line:

Note: Restrict access to this widget only necessary users. ^_^

#12797 report it
Trejder at 2013/04/12 05:15am
No downloadable files yet

Also, please download current version of master branch from your GitHub repository and upload here. Not anyone have account at GitHub and not anyone will notice, that you provided link to it.

With no downloadable files, someone might think, this is dead extension.

#12796 report it
Trejder at 2013/04/12 05:14am
Incorrect access control

You have this piece of code in your controller:

if (!Yii::app()->user->isGuest) {
throw new Exception('Not access');

This is not how do you control access rights in Yii application. You should (read about and) use accessControl filter and accessRules() function in your (this or any other) controller for this purpose!

Leave a comment

Please to leave your comment.

Create extension