Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.448 diff -u -F^f -r1.448 common.inc --- includes/common.inc 25 May 2005 06:28:59 -0000 1.448 +++ includes/common.inc 1 Jun 2005 05:34:35 -0000 @@ -237,19 +237,27 @@ function drupal_not_found() { * Generates a 403 error if the request is not allowed. */ function drupal_access_denied() { + global $user; + header('HTTP/1.0 403 Forbidden'); watchdog('access denied', t('%page denied access.', array('%page' => theme('placeholder', $_GET['q']))), WATCHDOG_WARNING, l(t('view'), $_GET['q'])); - $path = drupal_get_normal_path(variable_get('site_403', '')); - $status = MENU_NOT_FOUND; - if ($path) { - menu_set_active_item($path); - $return = menu_execute_active_handler(); + if ($user->uid == 0) { + drupal_set_title(t('Access denied')); + $return = user_login(); } + else { + $path = drupal_get_normal_path(variable_get('site_403', '')); + $status = MENU_NOT_FOUND; + if ($path) { + menu_set_active_item($path); + $return = menu_execute_active_handler(); + } - if (empty($return)) { - drupal_set_title(t('Access denied')); - $return = message_access(); + if (empty($return)) { + drupal_set_title(t('Access denied')); + $return = message_access(); + } } print theme('page', $return); }