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

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

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


Revision 1.8 - (show annotations) (download)
Fri Nov 21 15:09:38 2008 UTC (12 months ago) by kbahey
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +22 -1 lines
File MIME type: text/plain
Added recipe for redirect on 403.
1 $Id: README.txt,v 1.7 2007/06/25 20:25:27 kbahey Exp $
2
3 Copyright 2005 http://2bits.com
4
5 Description
6 -----------
7 This module allows the site admin to create custom error pages for
8 404 (not found), and 403 (access denied).
9
10 Since the error pages are not real nodes, they do not belong a category
11 term, and hence will not show up in node listings.
12
13 It also allows the site admin to setup redirects for 404s. For example
14 if you had a page called foo and a page called xyz, then you moved them
15 to a page called bar, and abc respectively, you can setup a redirect pair
16 of:
17
18 ^foo$ bar
19 ^xyz$ abc
20
21 Users trying to access example.com/foo will be transparently redirected
22 to example.com/bar.
23
24 Features
25 --------
26 * Configurable page title and descriptions.
27 * Any HTML formatted text can be be put in the page body.
28 * Handles 404 and 403 errors at present. Drupal only allows those two
29 errors to be assigned custom pages. The design of this module is
30 flexible though and can accommodate future codes easily.
31 * The pages are themeable using the phptemplate_customerror() function
32 in the template.php. The first argument is the error code (currently
33 403 or 404), and the message content.
34 * The messages can contain PHP, using one of two methods:
35 - By using the phptemplate_customerror() function (see above).
36 - By using the PHP checkbox in the settings.
37 * Users who are not logged in and try to access an area that requires
38 login will be redirected to the page they were trying to access after
39 they login.
40 (Requires a minor change to common.inc, see INSTALL.txt for details).
41
42
43 Redirecting upon login
44 ----------------------
45 Here is an example of how to add custom PHP to a 403 to give the user the
46 option to login then redirect them to what they were after.
47
48 <?php
49 global $user;
50 if ($user->uid == 0) {
51 print '<p>If your user account has access to this page, please <a href="/user?' .
52 drupal_get_destination() . '">log</a>.</p>';
53 }
54 ?>
55
56 That way when there's a 403 they get redirected back to the page they were trying to access.
57 The above should be better refined to fit "best practices", such as doing this in a template.php
58 rather than code stored in the database, and probably call l() or url() so it works when clean
59 URL's are disabled.
60
61 Thanks to: Andrew Berry (http://drupal.org/user/71291 deviantintegral).
62
63 Database
64 --------
65 This module does not require any new database tables to be installed.
66
67 Installation:
68 -------------
69 Please see the INSTALL.txt document for details.
70
71 Bugs/Features/Patches
72 ---------------------
73 If you want to report bugs, feature requests, or submit a patch, please do so
74 at the project page on the Drupal web site.
75 http://drupal.org/project/customerror
76
77 Author
78 ------
79
80 Khalid Baheyeldin (http://baheyeldin.com/khalid and http://2bits.com)
81
82 If you use this module, find it useful, and want to send the author
83 a thank you note, then use the Feedback/Contact page at the URL above.
84
85 The author can also be contacted for paid customizations of this
86 and other modules.

  ViewVC Help
Powered by ViewVC 1.1.2