We need to start the application after we've swapped the user details from the cookie, otherwise $user is initialised by the LDAP_USERNAME credentials - which may not have access to all the attributes

This commit is contained in:
Deon George 2025-03-07 16:36:16 +11:00
parent e99e349c0b
commit be87a12f21
2 changed files with 3 additions and 3 deletions

View File

@ -16,15 +16,15 @@ return Application::configure(basePath: dirname(__DIR__))
)
->withMiddleware(function (Middleware $middleware) {
$middleware->appendToGroup('web', [
ApplicationSession::class,
SwapinAuthUser::class,
ApplicationSession::class,
CheckUpdate::class,
]);
$middleware->prependToGroup('api', [
EncryptCookies::class,
ApplicationSession::class,
SwapinAuthUser::class,
ApplicationSession::class,
AllowAnonymous::class,
]);

View File

@ -124,7 +124,7 @@
--}}
<div class="widget-content-left header-user-info ms-3">
<div class="widget-heading">
{{ $user->exists ? Arr::get($user->getAttribute('cn'),0,'Anonymous') : 'Anonymous' }}
{{ $user->exists ? Arr::get($user->getAttribute('cn'),0,Arr::get($user->getAttribute('entryuuid'),0,'Secret Person')) : 'Anonymous' }}
</div>
<div class="widget-subheading">
{{ $user->exists ? Arr::get($user->getAttribute('mail'),0,'') : '' }}