Index: modules/overlay/overlay.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v
retrieving revision 1.31
diff -u -p -r1.31 overlay.module
--- modules/overlay/overlay.module	31 Aug 2010 15:04:09 -0000	1.31
+++ modules/overlay/overlay.module	20 Sep 2010 18:46:25 -0000
@@ -62,8 +62,11 @@ function overlay_theme() {
  */
 function overlay_form_user_profile_form_alter(&$form, &$form_state) {
   if ($form['#user_category'] == 'account') {
+    global $user;
     $account = $form['#user'];
-    if (user_access('access overlay', $account)) {
+    // Display overlay preference fieldset only if current user can access the
+    // overlay and only on current user's own profile.
+    if (user_access('access overlay', $account) && $account->uid == $user->uid) {
       $form['overlay_control'] = array(
         '#type' => 'fieldset',
         '#title' => t('Administrative overlay'),
@@ -77,6 +80,14 @@ function overlay_form_user_profile_form_
         '#description' => t('Show administrative pages on top of the page you started from.'),
         '#default_value' => isset($account->data['overlay']) ? $account->data['overlay'] : 1,
       );
+
+      // Provide an extended description for users that have not yet set their
+      // overlay preference explaining how to disable the overlay and how to
+      // dismiss the message shown to screen reader users.
+      if (!isset($user->data['overlay'])) {
+        $form['overlay_control']['overlay']['#description'] .= '<p>' . t('<strong>Accessibility notice:</strong> If you have problems accessing administrative pages opening in overlays, disable the overlays by unchecking this option and saving your profile. To dismiss the message shown at the top of pages to screen reader users, leave the option checked and save your profile.') . '</p>';
+      }
+
     }
   }
 }
@@ -85,7 +96,9 @@ function overlay_form_user_profile_form_
  * Implements hook_user_presave().
  */
 function overlay_user_presave(&$edit, $account, $category) {
-  if (isset($edit['overlay'])) {
+  global $user;
+  // Only allow user's own overlay preference to be set.
+  if (isset($edit['overlay']) && $account->uid == $user->uid) {
     $edit['data']['overlay'] = $edit['overlay'];
   }
 }
@@ -258,6 +271,42 @@ function overlay_page_alter(&$page) {
     // Add the overlay wrapper before the html wrapper.
     array_unshift($page['#theme_wrappers'], 'overlay');
   }
+  elseif ($link = _overlay_disable_link()) {
+    $page['page_top']['disable_overlay'] = $link;
+  }
+}
+
+/**
+ * Returns a renderable array representing a link to disable the Overlay.
+ *
+ * If the current user can access the overlay, but has not set a preference
+ * regarding the overlay in the user account settings, then this function
+ * returns a link to disable the overlay.
+ */
+function _overlay_disable_link() {
+  global $user;
+
+  $build = array();
+  if (!isset($user->data['overlay']) && user_access('access overlay')) {
+    $build = array(
+      '#type' => 'link',
+      '#title' => t('Administrative pages currently open in overlay windows. If you cannot access them or want to dismiss this message, click here to set your overlay preference.'),
+      '#href' => 'user/' . $user->uid . '/edit',
+      '#options' => array(
+        'query' => drupal_get_destination(),
+        'fragment' => 'edit-overlay-control',
+        'attributes' => array(
+          // Prevent the target page from being opened in the overlay, and make
+          // this link visible for screen-readers only.
+          'class' => array('overlay-exclude', 'element-invisible', 'element-focusable'),
+        ),
+      ),
+      '#prefix' => '<div id="overlay-disable-link">',
+      '#suffix' => '</div>',
+      '#weight' => -99,
+    );
+  }
+  return $build;
 }
 
 /**
@@ -324,9 +373,9 @@ function overlay_preprocess_maintenance_
  * @see overlay.tpl.php
  */
 function template_preprocess_overlay(&$variables) {
-  $variables['tabs']              = menu_primary_local_tasks();
-  $variables['title']             = drupal_get_title();
-
+  $variables['tabs'] = menu_primary_local_tasks();
+  $variables['title'] = drupal_get_title();
+  $variables['disable_overlay'] = _overlay_disable_link();
   $variables['content_attributes_array']['class'][] = 'clearfix';
 }
 
Index: modules/overlay/overlay.tpl.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/overlay/overlay.tpl.php,v
retrieving revision 1.4
diff -u -p -r1.4 overlay.tpl.php
--- modules/overlay/overlay.tpl.php	16 Sep 2010 19:47:45 -0000	1.4
+++ modules/overlay/overlay.tpl.php	20 Sep 2010 18:46:26 -0000
@@ -21,6 +21,7 @@
  */
 ?>
 
+<?php print render($disable_overlay); ?>
 <div id="overlay" <?php print $attributes; ?>>
   <div id="overlay-titlebar" class="clearfix">
     <div id="overlay-title-wrapper" class="clearfix">
