From 3857de8499468597eed7d7042647f1f4d5728011 Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 24 Aug 2022 14:47:40 +0200 Subject: [PATCH] fix: [notice] errors when not logged in removed --- src/Controller/Component/Navigation/Users.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Controller/Component/Navigation/Users.php b/src/Controller/Component/Navigation/Users.php index 0b2030a..4b1837b 100644 --- a/src/Controller/Component/Navigation/Users.php +++ b/src/Controller/Component/Navigation/Users.php @@ -25,7 +25,7 @@ class UsersNavigation extends BaseNavigation $bcf = $this->bcf; $request = $this->request; $passedData = $this->request->getParam('pass'); - $currentUserId = $this->currentUserId; + $currentUserId = empty($this->currentUserId) ? null : $this->currentUserId; $currentUser = $this->currentUser; $this->bcf->addLink('Users', 'view', 'UserSettings', 'index', function ($config) use ($bcf, $request, $passedData, $currentUser) { if (!empty($passedData[0])) { @@ -75,6 +75,7 @@ class UsersNavigation extends BaseNavigation !empty(Configure::read('keycloak.enabled')) && !empty(Configure::read('keycloak.provider.baseUrl')) && !empty(Configure::read('keycloak.provider.realm')) && + !empty($passedData[0]) && $currentUserId == $passedData[0] ) { $url = sprintf(