[TYPO3-english] Login from eid
Rafael Freuler
rafi at reizvoll.ch
Wed Dec 9 08:19:05 CET 2009
Hi
I would like to log a user in from an eid script.
It used to work with the code below but stopped working since I
updated to TYPO3 4.3.
Does anyone know what changed? Or how should I log in a user from my script?
Thanks in advance and best regards,
Rafi
// init user
$newuser = tslib_eidtools::initFeUser(); // Initialize FE user object
$GLOBALS['TSFE']->fe_user = $newuser;
$GLOBALS['TSFE']->fe_user->checkPid = $data['pid'];
$info= $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
$newuser=$GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'],$loginData['uname']);
// check md5 of pw with stored md5 pw
if (md5($loginData['uident']) == $newuser['password']) {
$ok = TRUE;
}
if($ok) {
//login successful
// DOES NOT WORK
//$GLOBALS['TSFE']->fe_user->start();
//$GLOBALS['TSFE']->initFEuser();
$GLOBALS['TSFE']->fe_user->createUserSession($newuser);
$GLOBALS['TSFE']->loginUser = 1;
//return $GLOBALS['TSFE']->fe_user;
$userdata = $newuser;
} else {
//login failed
$userdata = false;
}
More information about the TYPO3-english
mailing list