[Typo3-dev] RFC // Hook wanted for class.t3lib_userauth.php->logoff()

Andreas Otto ao-lists at php4win.de
Fri Jun 3 15:26:49 CEST 2005


Hi,

I would like to suggest adding two hooks to class.t3lib_userauth.php in
the logoff() Method.

One hook for doing operations __before__ logoff() destroys the current
session and one hook for doing operations __after__ the session was
destroyed.

The code is actually quite simple:

  // Hook for pre-processing the logoff() method:
if ( is_array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'
['tslib/class.tslib_feuserauth.php']['logoff_pre_processing'] ) ) {
  $_params = array();
  foreach( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'
['tslib/class.tslib_feuserauth.php']['logoff_pre_processing'] as
$_funcRef ) {
    if ($_funcRef) {
      t3lib_div::callUserFunction($_funcRef,$_params,$this);
    }
  }
}


  // Hook for post-processing the logoff() method:
if ( is_array( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'
['tslib/class.tslib_feuserauth.php']['logoff_post_processing'] ) ) {
  $_params = array();
  foreach( $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'
['tslib/class.tslib_feuserauth.php']['logoff_post_processing'] as
$_funcRef ) {
    if ($_funcRef) {
      t3lib_div::callUserFunction($_funcRef,$_params,$this);
    }
  }
}


Any comments?
A patch in unified diff format is available on request.


Cheers,
Andreas

-- 
Choose a data representation that makes the program simple.
            - The Elements of Programming Style (Kernighan & Plaugher)





More information about the TYPO3-dev mailing list