cvs diff -u common.inc (in directory D:\cvswork\drupal.org\drupal\includes\)
Index: common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.484
diff -u -r1.484 common.inc
--- common.inc	8 Oct 2005 12:38:20 -0000	1.484
+++ common.inc	13 Oct 2005 03:02:16 -0000
@@ -287,21 +287,28 @@
  * Generates a 403 error if the request is not allowed.
  */
 function drupal_access_denied() {
-  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 (empty($return)) {
+  global $user;
+  
+  if (!$user->uid) {
     drupal_set_title(t('Access denied'));
-    $return = t('You are not authorized to access this page.');
+    print theme('page', user_login(array(), t('You are not authorized to access this page. Please login to continue.')));
+  } else {
+    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 (empty($return)) {
+      drupal_set_title(t('Access denied'));
+      $return = t('You are not authorized to access this page.');
+    }
+    print theme('page', $return);
   }
-  print theme('page', $return);
 }
 
 /**
