lpa Posted January 17, 2018 Share Posted January 17, 2018 I have defined a login-handler shown below to print the login-form on each page that requires access when the user is not logged in and is under some parent-page: if ($page->parents->has('name=memberpage') { $section = 'memberpage'; } if(!$user->isLoggedin() and $section != '') { # print the login form } elseif ($user->isLoggedin() and restrict_content($section)) { # user doesn't belong to the required group } This way I can show login-form on the same page that is restricted and not redirect the user to a separate login-page. Now I tried to use CustomPageRoles module for simple access control. But the module redirects me to the 404-page when I don't have access, when not logged in. How could I just check whether to print the login form or show the page with CustomPageRoles handling the access control roles? Can I somehow read with the api that the user doesn't have access to the page without redirection to 404? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now