[TYPO3-english] Login from eid
Dmitry Dulepov
dmitry.dulepov at gmail.com
Wed Dec 9 11:16:21 CET 2009
Hi!
On 09/12/2009 09:19, Rafael Freuler wrote:
> // DOES NOT WORK
> //$GLOBALS['TSFE']->fe_user->start();
> //$GLOBALS['TSFE']->initFEuser();
Here is what I use since 4.2.0. It works also in 4.3:
$tsfeClassName = t3lib_div::makeInstanceClassName('tslib_fe');
$GLOBALS['TSFE'] = new $tsfeClassName($GLOBALS['TYPO3_CONF_VARS'], intval(t3lib_div::_GP('id')), '');
$GLOBALS['TSFE']->connectToMySQL();
$GLOBALS['TSFE']->initFEuser();
You can also use a function from tslib_eidtools to initialize FE user.
> $GLOBALS['TSFE']->fe_user->createUserSession($newuser);
> $GLOBALS['TSFE']->loginUser = 1;
You need not to call two lines above.
--
Dmitry Dulepov
"Trust me, I am a doctor!" (c) Gregory House, M.D.
More information about the TYPO3-english
mailing list