script

Wednesday, March 13, 2013

create automatic login in typo3

$UserData = $GLOBALS["TYPO3_DB"]->exec_SELECTgetrows('uid,username,password','fe_users','username="'.$user_profile['email'].'"');
           
 $loginData = array('uname' => $UserData[0]['username'], 'uident'=> $UserData[0]['password'] ,'status' =>'login');
$GLOBALS['TSFE']->fe_user->checkPid=0;
$info = $GLOBALS['TSFE']->fe_user->getAuthInfoArray();
                   
$user = $GLOBALS['TSFE']->fe_user->fetchUserRecord($info['db_user'],$loginData['uname']);
                    $login_success = $GLOBALS['TSFE']->fe_user->compareUident($user,$loginData);
 if($login_success){
$GLOBALS['TSFE']->fe_user->createUserSession($user);
header("Location:".$this->getURL($GLOBALS["TSFE"]->id));
exit;
}

Tuesday, March 5, 2013

Call function using typoscript

includeLibs.CLASS_NAME = typo3conf/ext/location_search/pi1/CLASS_NAME.php
lib.metaTag = USER
lib.metaTag{
  userFunc = user_CLASS_NAME->FUNC_NAME
}

page.headerData.5 < lib.metaTag