/** * Initialise feUser */ protected function initializeUserAuthentication() { if ($this->feUser === null) { $this->feUser = \TYPO3\CMS\Frontend\Utility\EidUtility::initFeUser(); $this->feUser->fetchGroupData(); } }
/** * */ protected function initializeUserAuthentication() { $this->feUserObj = EidUtility::initFeUser(); $this->feUserObj->fetchGroupData(); $this->databaseConnection = $GLOBALS['TYPO3_DB']; // This is obsolete since 6.1 but required for versions before. // It can be removed once support for TYPO3 below 6.1 is dropped. if (!$this->databaseConnection->isConnected()) { $this->databaseConnection->connectDB(); } }
/** * Initializes the front-end user groups. * Sets ->loginUser and ->gr_list based on front-end user status. * * @return void * @todo Define visibility */ public function initUserGroups() { // This affects the hidden-flag selecting the fe_groups for the user! $this->fe_user->showHiddenRecords = $this->showHiddenRecords; // no matter if we have an active user we try to fetch matching groups which can be set without an user (simulation for instance!) $this->fe_user->fetchGroupData(); if (is_array($this->fe_user->user) && count($this->fe_user->groupData['uid'])) { // global flag! $this->loginUser = TRUE; // group -2 is not an existing group, but denotes a 'default' group when a user IS logged in. This is used to let elements be shown for all logged in users! $this->gr_list = '0,-2'; $gr_array = $this->fe_user->groupData['uid']; } else { $this->loginUser = FALSE; // group -1 is not an existing group, but denotes a 'default' group when not logged in. This is used to let elements be hidden, when a user is logged in! $this->gr_list = '0,-1'; if ($this->loginAllowedInBranch) { // For cases where logins are not banned from a branch usergroups can be set based on IP masks so we should add the usergroups uids. $gr_array = $this->fe_user->groupData['uid']; } else { // Set to blank since we will NOT risk any groups being set when no logins are allowed! $gr_array = array(); } } // Clean up. // Make unique... $gr_array = array_unique($gr_array); // sort sort($gr_array); if (count($gr_array) && !$this->loginAllowedInBranch_mode) { $this->gr_list .= ',' . implode(',', $gr_array); } if ($this->fe_user->writeDevLog) { GeneralUtility::devLog('Valid usergroups for TSFE: ' . $this->gr_list, 'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController'); } }