[TYPO3-dev] Logoff hooks

Dave Sexton list-typo3 at jack.org.uk
Tue Mar 27 22:34:22 CEST 2012


Aha!

I can use the reference back to t3lib_userauth and call the
getLoginFormData function to retrieve the state of the login form (if
any). This will indicate if a logout button has been clicked.

Eg.:

function logoff_post_processing (&$params, &$reference) {
  $form = $reference->getLoginFormData();
    if (isset($form['status']) && $form['status']  == 'logout') {
	// Do forum lgout
    }
}

On Mon, 2012-03-26 at 19:07 +0100, Dave Sexton wrote:
> Hi,
> 
> I am currently working on an authentication service to integrate typo3
> with a forum. I am aiming for a SSO style integration and so am looking
> at both login and logoff.
> 
> I am aware of the hooks in the logoff function of t3lib_userauth and
> these look to be exactly what I need in order to trigger a logout of the
> forum software when the user explicitly logs out of Typo3. The only
> problem is that the hook seems to get called several times during a page
> load when no user is logged into Typo3. I cannot see any difference in
> the data passed to the function during a 'real' or 'fake' logoff.
> 
> Obviously, I only want to trigger a forum logoff when the user has
> explicitly requested a logoff but I cannot see how to identify when that
> has occurred.
> 
> Can anyone shed some light on this for me please?
> 
> Thanks in advance,
> 
> Dave
> 
> _______________________________________________
> 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