]> git.andy128k.dev Git - ipf.git/commitdiff
remove shortcut from admin app
authorAndrey Kutejko <andy128k@gmail.com>
Tue, 19 Aug 2014 18:44:46 +0000 (21:44 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Tue, 19 Aug 2014 18:44:46 +0000 (21:44 +0300)
ipf/admin/views.php

index 19a2b6bc0fa2014f74120852c292e8a98273111d..3955ab7a3f94376fc957bd2c7fc155d101241a46 100644 (file)
@@ -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);
     }