[TYPO3-dev] Current pid not yet available while FE authentication?

Richard Davies richard at ocular.co.nz
Thu Nov 22 21:42:21 CET 2012


Hi Steffen,

I've thought this through and there are a couple of 'hack' ways to do this:
1. Use the array $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] in
conjunction with database lookups to decode the URL yourself (or use a part
of RealUrl if it allows it
2. If all you need is the site rootline pid, you can use the table
sys_domain. Get the domain name from global vars, then select pid from
sys_domain where domainName = $domainName

Richard


On 23 November 2012 08:33, Steffen Müller <typo3 at t3node.com> wrote:

> Hi.
>
> I am struggling with the following problem:
>
> I use my own authentication service (added with
> t3lib_extMgm::addService(), as subtype 'authUserFE, getUserFE').
>
> Within my getUser() function I need to access some settings from
> TypoScript. I have a multidomain environment where domain specific
> settings are stored in TS.
>
> Since TS is not yet available, I tried some routines from EXT:timtab [1]
> to fetch TS. It requires a pid and fetches it from
> $GLOBALS['TSFE']->id. But unfortunately, it is not yet set.
>
> And I can't simply extract it from
> t3lib_div::getIndpEnv('TYPO3_REQUEST_URL') because I use realurl.
>
> How to get the current pid within authentication services?
>
>
>
> [1]
>
> $template = array();
>
> $tsParser = t3lib_div::makeInstance('t3lib_tsparser_ext');
> $tsParser->tt_track = 0;
> $tsParser->init();
>
> $sysPage = t3lib_div::makeInstance('t3lib_pageSelect');
> $rootLine = $sysPage->getRootLine($GLOBALS['TSFE']->id);
>
> $tsParser->runThroughTemplates($rootLine);
> $tsParser->generateConfig();
>
> $setup = $tsParser->setup['plugin.']['tx_atlantik.']['settings.'];
> $constants =
> $tsParser->setup_constants['plugin.']['tx_atlantik.']['settings.'];
>
> if (is_array($setup) && is_array($constants)) {
> $setup = t3lib_div::array_merge_recursive_overrule($setup, $constants, 1);
> }
>
> return $setup;
>
> --
> cheers,
> Steffen
>
> TYPO3 Blog: http://www.t3node.com/
> Twitter: @t3node - http://twitter.com/t3node
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list