summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-09-01 06:12:47 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-09-01 06:12:47 +0000
commit06c98414802d24c6bc7e42298f911176b863d72f (patch)
tree5e4eb6631580d714842122e4bafa344d4f1a14ad /includes/common.inc
parent30c2e89ce701b3b4d71cdb81815418655f663a30 (diff)
downloadbrdo-06c98414802d24c6bc7e42298f911176b863d72f.tar.gz
brdo-06c98414802d24c6bc7e42298f911176b863d72f.tar.bz2
That help text was in the 40x messages.
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc32
1 files changed, 23 insertions, 9 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 73839d2d3..0eb565d2e 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -318,16 +318,22 @@ function drupal_site_offline() {
*/
function drupal_not_found() {
drupal_set_header('HTTP/1.0 404 Not Found');
-
watchdog('page not found', check_plain($_GET['q']), WATCHDOG_WARNING);
+ $return = '';
+
+ if (variable_get('site_404_message_display', TRUE)) {
+ $message = variable_get('site_404_message', t('We are sorry, the requested page was not found on this webserver. Either the URL does not exist or the page you were looking has been deleted.'));
+ drupal_set_message(filter_xss_admin($message));
+ }
+
// Keep old path for reference
if (!isset($_REQUEST['destination'])) {
$_REQUEST['destination'] = $_GET['q'];
}
$path = drupal_get_normal_path(variable_get('site_404', ''));
- if ($path && $path != $_GET['q']) {
+ if (!empty($path) && $path != $_GET['q']) {
menu_set_active_item($path);
$return = menu_execute_active_handler();
}
@@ -336,8 +342,9 @@ function drupal_not_found() {
menu_set_active_item('');
}
- if (empty($return)) {
- drupal_set_title(t('Page not found'));
+ if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
+ drupal_set_title(t('404 - File not found'));
+ $return = '&nbsp;';
}
// To conserve CPU and bandwidth, omit the blocks
print theme('page', $return, FALSE);
@@ -350,13 +357,20 @@ function drupal_access_denied() {
drupal_set_header('HTTP/1.0 403 Forbidden');
watchdog('access denied', check_plain($_GET['q']), WATCHDOG_WARNING);
-// Keep old path for reference
+ $return = '';
+
+ if (variable_get('site_403_message_display', TRUE)) {
+ $message = variable_get('site_403_message', t('We are sorry, you do not have access to this page. If you are not already logged in, please try to login and then visit this page again. If you think should be able to access this page, please contact site admins.'));
+ drupal_set_message(filter_xss_admin($message));
+ }
+
+ // Keep old path for reference
if (!isset($_REQUEST['destination'])) {
$_REQUEST['destination'] = $_GET['q'];
}
$path = drupal_get_normal_path(variable_get('site_403', ''));
- if ($path && $path != $_GET['q']) {
+ if (!empty($path) && $path != $_GET['q']) {
menu_set_active_item($path);
$return = menu_execute_active_handler();
}
@@ -365,9 +379,9 @@ function drupal_access_denied() {
menu_set_active_item('');
}
- if (empty($return)) {
- drupal_set_title(t('Access denied'));
- $return = t('You are not authorized to access this page.');
+ if (empty($return) || $return == MENU_NOT_FOUND || $return == MENU_ACCESS_DENIED) {
+ drupal_set_title(t('403 - Access denied'));
+ $return = '&nbsp;';
}
print theme('page', $return);
}