Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TYPO3 - Redirecting to login page when user is not logged in

I have some restricted pages built in Typo3. The problem is I cannot automatically redirect user from these pages to login page. How do I do that? I desperately need it and cannot find a solution despite of the fact I have spent most of the day working on it :(

Any help will be much appreciated.

like image 280
Jacek Francuz Avatar asked Nov 15 '11 18:11

Jacek Francuz


2 Answers

That should work fine:

# Restricted area starts at pid 123.
# Check if user is logged in:
[PIDinRootline = 123] && [usergroup = *]
# do something
[else]
page.config >
page.config.additionalHeaders = Location: http://www.yourdomain.org/login.html
[end]

Found here

like image 90
Mateng Avatar answered Nov 09 '22 07:11

Mateng


Just for reasons of documentation: make sure you choose the right redirect mode.

If I wish to redirect for a certain page after login, but only one specific user group should redirect to another page, then I choose two items for redirect and bring them to the right order. I choose them under page > Plugin > Redirect.

The order should be the way that the specific conditions are caught first.

This screenshot illustrates it:

Redirect options

This was tested for Typo3 6.1.3.

Hope that helps sb...

like image 31
peter_the_oak Avatar answered Nov 09 '22 06:11

peter_the_oak