[TYPO3-mvc] Fe Users don't have access for their personal data on TYPO3 6.2
Xavier Perseguers
xavier at typo3.org
Wed Sep 3 09:36:08 CEST 2014
Hi,
Dmitry Vasiliev wrote:
> In class AccessControlService
>
> public function hasLoggedInFrontendUser() {
> //works
> return $GLOBALS['TSFE']->loginUser == 1 ? TRUE : FALSE;
>
> //does not work
> return $GLOBALS['TSFE']->loginUser === 1 ? TRUE : FALSE;
> }
Due to PHP laxity and TYPO3 legacy, you may hardly assume an integer is
strictly an integer so you better write
return (int)$GLOBALS['TSFE']->loginUser === 1;
to be on the safe side (the ternary if operator is totally useless btw).
Kind regards
--
Xavier Perseguers
TYPO3 CMS Team Member
TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
More information about the TYPO3-project-typo3v4mvc
mailing list