[TYPO3-dev] hook/callback for password recovery in felogin / typo3 auth services

Michael Michalowski m.michalowski at hottgenroth.de
Tue Jul 20 16:15:41 CEST 2010


hi!

I implemented an authentication to a foreign database using a typo3 auth service in an extension.
Now I need the possibility to change the password in context of a "forgot password ?" functionality.
In detail I need a hook/callback function inside of tx_felogin. I already created a feature request and described my needs in the bugtracker:

http://bugs.typo3.org/view.php?id=15177

My approach is to use a method inside the auth service to change the password. tx_felogin could run through the registered auth services and call the method with the modified data.

This would be the code snippet in the pi1 plugin of felogin's changePassword-Method:

((code start))
                                                        // save new password and clear DB-hash
                                                $res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(
                                                                'fe_users',
                                                                'uid=' . $user['uid'],
                                                                array('password' => $newPass, 'felogin_forgotHash' => '')
                                                        );

                                                $serviceChain='';
                                                while (is_object($serviceObj = t3lib_div::makeInstanceService('auth', 'authUserFE', $serviceChain)))
                                                {
                                                        $serviceChain.=','.$serviceObj->getServiceKey();
                                                        if(method_exists($serviceObj, 'updateUser'))
                                                        {
                                                                $serviceObj->updateUser($user, array('password' => $newPass));
                                                        }
                                                        unset($serviceObj);
                                                }
((code end))

The updateUser method then would be placed inside the auth service plugin and is able to handle the changes in a foreign system (eg a custom database).

Because of the fact that the auth service concept is a very integrated feature I want to discuss this on the dev-list (please point me to the right communication channel, if this is not the one).

--
best regards,
Michael Michalowski




More information about the TYPO3-dev mailing list