[TYPO3-dev] hook after user login

Stefano Cecere scecere at krur.com
Thu Dec 20 01:48:06 CET 2012


i was looking for the hook after a successful login

the $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['felogin']['login_confirmed'] 
doesn't work well (it works only if the logout form gets rendered after 
a login.. if you don't want it.. it fails!)

i discovered that the best place where to put the hook woudl be into 
createUserSession() of class class t3lib_userAuth

this function is called whenever a new fe user session is created


On 15/12/11 08:58, Krystian Szymukowicz wrote:
> W dniu 2011-12-15 00:04, Steffen Müller wrote:
>> Hi.
>>
>> On 14.12.2011 21:33 Krystian Szymukowicz wrote:
>>>
>>> 2) I read that I can use:
>>> $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_userauth.php'
>>> ['postUserLookUp'][]
>>>
>>> but this is called everytime I refresh the page - even for not logged
>>> user
>>>
>>
>> according to the code comment, this hook was written for timtaw
>> extension. so maybe you have a look at this implementation.
>>
>> in the hook you have pObj as second parameter, which provides
>> $pObj->user(). This is an array with the current user.
>>
>> function postUserLookUp(&$params, &$pObj) {
>> if (is_array($this->user))
>> // add your logic here
>> } else {
>> return;
>> }
>> }
>>
>> Still not ideal in terms of performance, but "usual" practice in hooks.
>>
>
> Yes. I've been using this like that, but I thought there must be smth
> better for one time "after login hook" :)
>


-- 

-- --- ----- -------

Stefano Cecere
KRUR studio - http://krur.com



More information about the TYPO3-dev mailing list