lightning Swap User ¶
Change the user in a single click, for Yii Framework.
Usage: ¶
- Copy the repository.
- Unzip to protected folder.
- In layout/main.php or on dashboard admin use code, which is implemented on.
- Pass authentication.
<?php
$this->widget(
'Masked',
array(
'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('127.0.0.1', '::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.
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!
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.
Incorrect access control
@Trejder U true.
I was hoping to do a single line:
> Note: Restrict access to this widget only necessary users.
^_^
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.