File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -389,10 +389,7 @@ public function hasUserListings() {
389389 * @since 6.0.0
390390 */
391391 public function isSessionActive () {
392- if ($ this ->getCurrentUserId () !== '' ) {
393- return true ;
394- }
395- return false ;
392+ return $ this ->session ->get ('user_saml.samlUserData ' ) !== null ;
396393 }
397394
398395 /**
@@ -487,8 +484,15 @@ private function formatUserData($attributes) {
487484 * @since 6.0.0
488485 */
489486 public function getCurrentUserId () {
490- $ this ->userData ->setAttributes ($ this ->session ->get ('user_saml.samlUserData ' ) ?? []);
491- $ uid = $ this ->userData ->getEffectiveUid ();
487+ $ user = \OC ::$ server ->getUserSession ()->getUser ();
488+
489+ if ($ user instanceof IUser && $ this ->session ->get ('user_saml.samlUserData ' )) {
490+ $ uid = $ user ->getUID ();
491+ } else {
492+ $ this ->userData ->setAttributes ($ this ->session ->get ('user_saml.samlUserData ' ) ?? []);
493+ $ uid = $ this ->userData ->getEffectiveUid ();
494+ }
495+
492496 if ($ uid !== '' && $ this ->userExists ($ uid )) {
493497 $ uid = $ this ->userData ->testEncodedObjectGUID ($ uid );
494498
You can’t perform that action at this time.
0 commit comments