marți, 7 martie 2017

Typo3 hook when user logs in

best is to have your own extension under a folder like vendor_name (notice the underscore and the camelcasing below). in your extensions ext_localconf.php, configure your hook like: // hooks when logging in $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['postUserLookUp'][] = 'VendorName\Classes\Hooks\AfterRegistrationHook->postLogin'; and our file vendor_name/Classes/Hooks/AfterRegistrationHook.php should look like:
function postLogin(&$params, &$pObj) {
  if ($pObj->loginType === 'FE' &&
            $pObj->loginFailure === false &&
            is_array($pObj->user) &&
            $pObj->loginSessionStarted === true
        ) {
   print_r($params);
   die("here we are just after the user has logged in");


        }

 }


Niciun comentariu:

Trimiteți un comentariu