/[drupal]/contributions/modules/customerror/README.txt
ViewVC logotype

Diff of /contributions/modules/customerror/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6.2.2, Sat Sep 13 02:51:55 2008 UTC revision 1.6.2.3, Fri Nov 21 15:09:54 2008 UTC
# Line 1  Line 1 
1  $Id: README.txt,v 1.6.2.1 2007/06/25 20:24:36 kbahey Exp $  $Id: README.txt,v 1.6.2.2 2008/09/13 02:51:55 kbahey Exp $
2    
3  Copyright 2005 http://2bits.com  Copyright 2005 http://2bits.com
4    
# Line 39  Features Line 39  Features
39    they login.    they login.
40    (Requires a minor change to common.inc, see INSTALL.txt for details).    (Requires a minor change to common.inc, see INSTALL.txt for details).
41    
42    Redirecting upon login
43    ----------------------
44    Here is an example of how to add custom PHP to a 403 to give the user the
45    option to login then redirect them to what they were after.
46    
47    <?php
48    global $user;
49    if ($user->uid == 0) {
50      print '<p>If your user account has access to this page, please <a href="/user?' .
51        drupal_get_destination() . '">log</a>.</p>';
52    }
53    ?>
54    
55    That way when there's a 403 they get redirected back to the page they were trying to access.
56    The above should be better refined to fit "best practices", such as doing this in a template.php
57    rather than code stored in the database, and probably call l() or url() so it works when clean
58    URL's are disabled.
59    
60    Thanks to: Andrew Berry (http://drupal.org/user/71291 deviantintegral).
61    
62  Database  Database
63  --------  --------
64  This module does not require any new database tables to be installed.  This module does not require any new database tables to be installed.

Legend:
Removed from v.1.6.2.2  
changed lines
  Added in v.1.6.2.3

  ViewVC Help
Powered by ViewVC 1.1.2