app/controllers/backend/UserController.php: adding impersonateAction()
This commit is contained in:
parent
69fd7a6e19
commit
4ac770f733
1 changed files with 13 additions and 0 deletions
|
|
@ -113,4 +113,17 @@ class UserController extends \Phalcon\Mvc\Controller
|
||||||
}
|
}
|
||||||
$this->response->redirect('/admin');
|
$this->response->redirect('/admin');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function impersonateAction($id)
|
||||||
|
{
|
||||||
|
$user = User::findFirstById($id);
|
||||||
|
|
||||||
|
try {
|
||||||
|
$this->auth->impersonate($user);
|
||||||
|
$this->response->redirect('/');
|
||||||
|
} catch (\Exception $ex) {
|
||||||
|
$this->flash->error($ex->getMessage());
|
||||||
|
$this->response->redirect('/admin');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue