[TYPO3-dev] How to use hook on felogin - Disabling login for certain users

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Thu Jun 6 22:11:02 CEST 2013


On 06.06.2013 17:01, Jigal van Hemert wrote:
> Hi,
>
> On 6-6-2013 15:21, g4-lisz at tonarchiv.ch wrote:
>> The login for certain frotend users shoud be denied. There should be a
>> lookup in another DB table with a 'login_disabled' flag for each user.
>> I.e. how can I hook a function in the fe login process, which gets the
>> user uid and returns true or false (=allowed or not allowed)?
>
> The best way would be make an extension that implements an authentication service. If it has a higher priority that the 
> default service it can check the user data first and give the appropriate code to either:
> - approve the login and stop the authentication chain (not in your description)
> - say that the user isn't authenticated and to stop the authentication chain (login_disabled in your case)
> - say that the user isn't authenticated and that other services should check further (login_enabled in your case).
>
> In TER you can find examples of authentication services which you can use as model to create your own.
>
Hi,

authentication service is the keyword - thanks a lot!

I found this code:

t3lib_extMgm::addService($_EXTKEY, 'auth' /* sv type */, 'tx_example_sv1' /* sv key */,
     array(
         'title' => 'Example-Service',
         'description' => 'Authenticates against something different from TYPOs database!!!',
         'subtype' => 'authUserFE,getUserFE',
         'available' => true,
         'priority' => 80,
         'quality' => 80,
         'os' => '',
         'exec' => '',
         'classFile' => t3lib_extMgm::extPath($_EXTKEY).'sv1/class.tx_example_sv1.php',
         'className' => 'tx_example_sv1',
));

Though i'm not sure what quality means...

Could you please give me a link where to look in TER?

Thanks,
Till



More information about the TYPO3-dev mailing list