Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access rights, information might be incorrect #10

Closed
benabbottnz opened this issue Jul 19, 2019 · 5 comments · Fixed by #11
Closed

Access rights, information might be incorrect #10

benabbottnz opened this issue Jul 19, 2019 · 5 comments · Fixed by #11

Comments

@benabbottnz
Copy link

benabbottnz commented Jul 19, 2019

On this page: https://docs.typo3.org/m/typo3/tutorial-editors/master/en-us/AccessControl/Login/Index.html you will see a section talking about Access Rights and how you can set a "Members only" page.

If using the "Show at any login" Usergroup, the last sentence in that section claims that you'll be redirected to the home page, but in my experience with both a brand new TYPO3 site, and all my existing sites, TYPO3 will simply 404 if you try to access that page.

Is the documentation wrong, or has that functionality changed since it was written?

I'm having great difficulty figuring out how to redirect a user to either the Home page or the login page when accessing a page with invalid usergroup rights.

@sypets
Copy link
Contributor

sypets commented Jul 19, 2019

So you are looking for a way to redirect to a login page if you access a page with access restriction and are not logged in with a user that has access to the page?

Sounds reasonable to me. It appears the documentation may be wrong or at least it does not explain it sufficiently.

I have not been able to get this to work either. I found some solutions that were offered, none of them worked for me right away, but you may want to look there for further hints:

I will try to investigate further. This may take a while. Everyone is pretty busy right now getting everything ready for TYPO3 X.

I propose to leave this issue open until it is further investigated and corrected.

BTW, which TYPO3 version do you use?

@benabbottnz
Copy link
Author

I've been using TYPO3 9.

FelHell added a commit to FelHell/TYPO3CMS-Tutorial-Editors that referenced this issue Aug 2, 2019
@FelHell
Copy link
Contributor

FelHell commented Aug 2, 2019

When trying to access a page that can only be accessed by a usergroup, this error message in TYPO3 9.5 is shown:

typo3-page-not-found-subsection-not-accessible

@FelHell
Copy link
Contributor

FelHell commented Aug 2, 2019

@benabbottnz In TYPO3 9.5, the error message is generated in https://github.com/TYPO3/TYPO3.CMS/blob/16a8bcabe4d8a33a2bc8556b440ed92af0ee508b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L1456 and the method accessDeniedAction of \TYPO3\CMS\Frontend\Controller\ErrorController is called.

You can change the default behaviour by setting a value in the global configuration:

$GLOBALS['TYPO3_CONF_VARS']['FE']['pageNotFound_handling'] = 'REDIRECT:https://www.example.com/';

For example, this would redirect an unauthenticated frontend user to www.example.com when trying to access a restricted page.

@FelHell
Copy link
Contributor

FelHell commented Aug 2, 2019

Maybe it makes sense to add a reference to the pageNotFound_handling variable to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants