/** * Redirects to the Cookie Error Page if Cookie is not set and Cookie Error Page is defined. Otherwise nothing is done * * @param object tslib_pibase * @return boolean true if Cookies enabled, false if Cookies not disabled and no Error Page set or does not exist. * @author Dorit Rottner <*****@*****.**> */ public static function checkCookies(\TYPO3\CMS\Frontend\Plugin\AbstractPlugin $pObj) { if (!$_COOKIE['fe_typo_user']) { $redirect_url = $pObj->pi_linkTP_keepPIvars_url($overrulePIvars = array(), $cache = 1, $clearAnyway = 0, $GLOBALS['TSFE']->tmpl->setup['config.']['pt_extbase.']['cookieErrorPage']); if ($redirect_url) { GeneralUtility::devLog('Cookie not set redirect to ' . $redirect_url, 'pt_extbase', 1); header('Location: ' . GeneralUtility::locationHeaderUrl($redirect_url)); exit; } else { GeneralUtility::devLog('Cookie not set redirect url not specified. ', 'pt_extbase', 1); $return = false; } } else { $return = true; } return $return; }