Archived
1
0
Fork 0

app/controllers/backend/UserController.php: adding impersonateAction()

This commit is contained in:
Henrik Hautakoski 2023-04-30 17:49:36 +02:00
parent 69fd7a6e19
commit 4ac770f733

View file

@ -113,4 +113,17 @@ class UserController extends \Phalcon\Mvc\Controller
}
$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');
}
}
}