Project

General

Profile

Actions

Bug #88290

closed

$GLOBALS['TSFE']->loginUser is true for not login user.

Added by Patryk Ostrowski almost 5 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2019-05-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
frontendLogin feUser sysext
Complexity:
no-brainer
Is Regression:
Sprint Focus:
Remote Sprint

Description

Hello!

I have problem with TSFE login user
If we add usergroup for anonymous session, we still have anonymous session but typo3 think that is true login session $GLOBALS['TSFE']->loginUser is true

example record from fe_session which are visible as loginUser:

example record which cause problems

web/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

Problem is with this if:

if (is_array($this->fe_user->user) && !empty($this->fe_user->groupData['uid'])) {
    // global flag!
    $this->loginUser = true;
    $this->gr_list = '0,-2';
    $gr_array = $this->fe_user->groupData['uid'];
} else {
    $this->loginUser = false;

This code set true if any session is present (even anonymous!) and user group is present.

That is incorrect IMO and correct if condition should be:

if (is_array($this->fe_user->user) && !empty($this->fe_user->groupData['uid']) && !$this->fe_user->user['ses_anonymous'])

anonymous session is not loginUser session.


Files

Selection_999.png (19.6 KB) Selection_999.png example record which cause problems Patryk Ostrowski, 2019-05-07 12:12
Actions #1

Updated by Mathias Schreiber about 2 years ago

  • Sprint Focus set to Remote Sprint
Actions #2

Updated by Simon Schaufelberger about 2 years ago

  • Description updated (diff)
Actions #3

Updated by Simon Schaufelberger about 2 years ago

  • Description updated (diff)
Actions #4

Updated by Simon Schaufelberger about 2 years ago

  • Description updated (diff)
Actions #5

Updated by Simon Schaufelberger about 2 years ago

How can you add a usergroup to an anonymous session?

Actions #6

Updated by Larry Garfield about 2 years ago

  • Status changed from New to Resolved

The loginUser property no longer exists in TSFE Controller, so I think this issue is no longer relevant.

Actions #7

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF