Index: includes/common.inc =================================================================== --- includes/common.inc (revision 5440) +++ includes/common.inc (working copy) @@ -162,19 +162,27 @@ * 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); - $status = menu_execute_active_handler(); + if ($user->uid == 0) { + drupal_set_title(t('Please Login')); + print theme('page', user_login()); } + else { + $path = drupal_get_normal_path(variable_get('site_403', '')); + $status = MENU_NOT_FOUND; + if ($path) { + menu_set_active_item($path); + $status = menu_execute_active_handler(); + } - if ($status != MENU_FOUND) { - drupal_set_title(t('Access denied')); - print theme('page', message_access()); + if ($status != MENU_FOUND) { + drupal_set_title(t('Access denied')); + print theme('page', message_access()); + } } }