From: Andrey Kutejko Date: Tue, 19 Aug 2014 18:44:46 +0000 (+0300) Subject: remove shortcut from admin app X-Git-Tag: 0.6~189 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=37100e409c6df9e22e71701ec8fc563b8eddd15b;p=ipf.git remove shortcut from admin app --- diff --git a/ipf/admin/views.php b/ipf/admin/views.php index 19a2b6b..3955ab7 100644 --- a/ipf/admin/views.php +++ b/ipf/admin/views.php @@ -312,7 +312,9 @@ function IPF_Admin_Views_Impersonate($request, $match) $success_url = IPF_HTTP_URL::urlForView('IPF_Admin_Views_Index'); if (!$request->user->isAnonymous() && $request->user->is_superuser) { - $user = IPF_Shortcuts::GetObjectOr404('User', $match[1]); + $user = User::table()->findOneById($match[1]); + if (!$user) + return new IPF_HTTP_Response_NotFound($request); IPF_Auth_App::login($request, $user); }