%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11584/cwd/html/egp/vendor/yiisoft/yii2-debug/src/controllers/ |
Upload File : |
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\debug\controllers; use Yii; use yii\debug\models\UserSwitch; use yii\web\BadRequestHttpException; use yii\web\Controller; use yii\web\Response; /** * User controller * * @author Semen Dubina <yii2debug@sam002.net> * @since 2.0.10 */ class UserController extends Controller { /** * {@inheritdoc} * @throws BadRequestHttpException */ public function beforeAction($action) { Yii::$app->response->format = Response::FORMAT_JSON; if (!Yii::$app->session->hasSessionId) { throw new BadRequestHttpException('Need an active session'); } return parent::beforeAction($action); } /** * Set new identity, switch user * @return \yii\web\User * @throws \yii\base\InvalidConfigException */ public function actionSetIdentity() { $user_id = Yii::$app->request->post('user_id'); $userSwitch = new UserSwitch(); $newIdentity = Yii::$app->user->identity->findIdentity($user_id); $userSwitch->setUserByIdentity($newIdentity); return Yii::$app->user; } /** * Reset identity, switch to main user * @return \yii\web\User * @throws \yii\base\InvalidConfigException */ public function actionResetIdentity() { $userSwitch = new UserSwitch(); $userSwitch->reset(); return Yii::$app->user; } }