By grippat on
How do I go about adding a user login section on the access denied page? I want to be able to give people a chance to login easily if they clicked on a restricted link before logging in.
Alternatively, is there a way to set the access denied page to automatically forward to another page after a set amount of time?
Also, is there a php statement that would allow me to determine if a user is currently logged in so I could display certain information on a page only if they're logged in?
Comments
Access denied page...
First thing you surely know: You can create your own page, and type its URL-alias into admin settings, to show that page in "access denied" case.
To add login to this, I would edit the visibility of login sidebar-block, to be visible on this custom "access denied" page. These are simple suggestions, just to ensure you didn't forget :-)
Forwarding to another page after some time - I don't remember exactly, but there's some code to do this, which you can include into the body-HTML-text of your page.
To determine whether the user is logged in or not, you can set your page's text format (filter) to php-code and include something like this:
But of course - be cautious while using the php-code option.
Thank you for the info
Thank you for the info JirkaRybka. I had no idea you could set a custom page for drupal to go to in the case of denied access. I'm pretty new to drupal so I'm still learning.
I added index.html as my
I added index.html as my access denied page in admin settings. It isnt showing up. What do I do?