Skip to content
Snippets Groups Projects
Commit 887cc28d authored by Khalid Baheyeldin's avatar Khalid Baheyeldin
Browse files

Added recipe for 403 redirect.

parent 9251e30f
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,26 @@ Features ...@@ -39,6 +39,26 @@ Features
they login. they login.
(Requires a minor change to common.inc, see INSTALL.txt for details). (Requires a minor change to common.inc, see INSTALL.txt for details).
Redirecting upon login
----------------------
Here is an example of how to add custom PHP to a 403 to give the user the
option to login then redirect them to what they were after.
<?php
global $user;
if ($user->uid == 0) {
print '<p>If your user account has access to this page, please <a href="/user?' .
drupal_get_destination() . '">log</a>.</p>';
}
?>
That way when there's a 403 they get redirected back to the page they were trying to access.
The above should be better refined to fit "best practices", such as doing this in a template.php
rather than code stored in the database, and probably call l() or url() so it works when clean
URL's are disabled.
Thanks to: Andrew Berry (http://drupal.org/user/71291 deviantintegral).
Database Database
-------- --------
This module does not require any new database tables to be installed. This module does not require any new database tables to be installed.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment