Merge pull request #189 from Wachizungu/chg-load-current-user-settings-view-in-case-id-unset

fix: users settings view throws internal server error when accessed w…
pull/190/head
Andras Iklody 2024-11-23 09:53:24 +01:00 committed by GitHub
commit 1702b84fe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -487,7 +487,7 @@ class UsersController extends AppController
{
$editingAnotherUser = false;
$currentUser = $this->ACL->getUser();
if ((empty($currentUser['role']['perm_community_admin']) && empty($currentUser['role']['perm_group_admin'])) || $user_id == $currentUser->id) {
if ((empty($currentUser['role']['perm_community_admin']) && empty($currentUser['role']['perm_group_admin'])) || empty($user_id) || $user_id == $currentUser->id) {
$user = $currentUser;
} else {
$user = $this->Users->get($user_id, [