File tree 2 files changed +19
-3
lines changed
2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -406,14 +406,22 @@ public function initialize(PKPRequest $request)
406
406
* database is executed (e.g., when loading installer pages).
407
407
*/
408
408
if (!PKPSessionGuard::isSessionDisable ()) {
409
+ $ loggedInAsUserId = Validation::loggedInAs ();
410
+
409
411
$ this ->assign ([
410
412
'isUserLoggedIn ' => Validation::isLoggedIn (),
411
- 'isUserLoggedInAs ' => (bool ) Validation:: loggedInAs () ,
413
+ 'isUserLoggedInAs ' => (bool ) $ loggedInAsUserId ,
412
414
'itemsPerPage ' => Config::getVar ('interface ' , 'items_per_page ' ),
413
415
'numPageLinks ' => Config::getVar ('interface ' , 'page_links ' ),
414
416
'siteTitle ' => $ request ->getSite ()->getLocalizedData ('title ' ),
415
417
]);
416
418
419
+ if ($ loggedInAsUserId ) {
420
+ $ this ->assign ([
421
+ 'loggedInAsUser ' => Repo::user ()->get ($ loggedInAsUserId )
422
+ ]);
423
+ }
424
+
417
425
$ user = $ request ->getUser ();
418
426
if ($ user ) {
419
427
$ unreadNotificationCount = Notification::withRead (false )
Original file line number Diff line number Diff line change 85
85
</div >
86
86
<dropdown class =" app__headerAction app__userNav" >
87
87
<template #button >
88
+ { if $isUserLoggedInAs }
89
+ { assign var= " activeUser" value= $loggedInAsUser }
90
+ { else }
91
+ { assign var= " activeUser" value= $currentUser }
92
+ { /if }
88
93
<initials-avatar
94
+ initials =" { $activeUser -> getDisplayInitials ()|escape } "
89
95
:is-secondary =" true"
90
96
{ if $isUserLoggedInAs }
91
97
:is-disabled =" true"
92
98
{ /if }
93
99
></initials-avatar >
100
+ <span class =" -screenReader" >"{ $activeUser -> getData (' userName' )|escape } "</span >
94
101
{ if $isUserLoggedInAs }
95
102
<initials-avatar
96
- class =" absolute right-2 top-2 rounded-full h-5 w-5"
103
+ initials =" { $currentUser -> getDisplayInitials ()|escape } "
104
+ class =" absolute right-2 top-0 rounded-full h-5 w-5"
97
105
:is-warnable =" true"
98
106
:shrink =" true"
99
107
></initials-avatar >
108
+ <span class =" -screenReader" >{ $currentUser -> getData (' userName' )|escape } </span >
100
109
{ /if }
101
- <span class =" -screenReader" >{ $currentUser -> getData (' userName' )} </span >
102
110
</template >
103
111
<nav aria-label =" { translate key= " common.navigation.user" } " >
104
112
{ if $supportedLocales |@count > 1}
You can’t perform that action at this time.
0 commit comments