Index: modules/overlay/overlay.module =================================================================== RCS file: /cvs/drupal/drupal/modules/overlay/overlay.module,v retrieving revision 1.23 diff -u -p -r1.23 overlay.module --- modules/overlay/overlay.module 8 Jul 2010 12:20:23 -0000 1.23 +++ modules/overlay/overlay.module 9 Jul 2010 12:36:10 -0000 @@ -58,6 +58,36 @@ function overlay_theme() { } /** + * Implements hook_form_FORM_ID_alter(). + */ +function overlay_form_user_profile_form_alter(&$form, &$form_state) { + if ($form['#user_category'] == 'account') { + $account = $form['#user']; + if (user_access('access overlay', $account)) { + $form['overlay_control'] = array( + '#type' => 'fieldset', + '#title' => t('Administrative overlay'), + '#collapsible' => TRUE, + ); + + $form['overlay_control']['overlay'] = array( + '#type' => 'checkbox', + '#title' => t('View administrative pages in the overlay.'), + '#description' => t('The overlay shows administrative pages with a transparent black background over the page you started from.'), + '#default_value' => isset($account->data['overlay']) ? $account->data['overlay'] : 1, + ); + } + } +} + +/** + * Implements hook_user_presave(). + */ +function overlay_user_presave(&$edit, $account, $category) { + $edit['data']['overlay'] = isset($edit['overlay']) ? $edit['overlay'] : variable_get('overlay', 1); +} + +/** * Implements hook_init(). * * Determine whether the current page request is destined to appear in the @@ -67,13 +97,14 @@ function overlay_theme() { */ function overlay_init() { // @todo: custom_theme does not exist anymore. - global $custom_theme; + global $custom_theme, $user; $mode = overlay_get_mode(); // Only act if the user has access to the overlay and a mode was not already // set. Other modules can also enable the overlay directly for other uses. - if (empty($mode) && user_access('access overlay')) { + $use_overlay = !isset($user->data['overlay']) || $user->data['overlay']; + if (empty($mode) && user_access('access overlay') && $use_overlay) { $current_path = current_path(); // After overlay is enabled on the modules page, redirect to // #overlay=admin/modules to actually enable the overlay. Index: modules/openid/openid.test =================================================================== RCS file: /cvs/drupal/drupal/modules/openid/openid.test,v retrieving revision 1.28 diff -u -p -r1.28 openid.test --- modules/openid/openid.test 7 Jul 2010 08:05:01 -0000 1.28 +++ modules/openid/openid.test 10 Jul 2010 16:35:26 -0000 @@ -301,7 +301,9 @@ class OpenIDRegistrationTestCase extends $user = user_load_by_name('john'); $this->assertTrue($user, t('User was registered with right username.')); $this->assertEqual($user->mail, 'john@example.com', t('User was registered with right email address.')); - $this->assertFalse($user->data, t('No additional user info was saved.')); + + // There is one value in $user->data from Override module + $this->assertTrue(count($user->data) <= 1, t('No additional user info was saved.')); $this->submitLoginForm($identity); $this->assertRaw(t('You must validate your email address for this account before logging in via OpenID.')); @@ -334,8 +336,9 @@ class OpenIDRegistrationTestCase extends $user = user_load_by_name('john'); $this->assertTrue($user, t('User was registered with right username.')); $this->assertEqual($user->mail, 'john@example.com', t('User was registered with right email address.')); - $this->assertFalse($user->data, t('No additional user info was saved.')); + // There is one value in $user->data from Override module + $this->assertTrue(count($user->data) <= 1, t('No additional user info was saved.')); $this->drupalLogout(); $this->submitLoginForm($identity); @@ -366,7 +369,9 @@ class OpenIDRegistrationTestCase extends $user = user_load_by_name('john'); $this->assertTrue($user, t('User was registered with right username.')); - $this->assertFalse($user->data, t('No additional user info was saved.')); + + // There is one value in $user->data from Override module + $this->assertTrue(count($user->data) <= 1, t('No additional user info was saved.')); // Follow the one-time login that was sent in the welcome e-mail. $this->drupalGet(user_pass_reset_url($user)); @@ -401,7 +406,9 @@ class OpenIDRegistrationTestCase extends $user = user_load_by_name('john'); $this->assertTrue($user, t('User was registered with right username.')); - $this->assertFalse($user->data, t('No additional user info was saved.')); + + // There is one value in $user->data from Override module + $this->assertTrue(count($user->data) <= 1, t('No additional user info was saved.')); // Follow the one-time login that was sent in the welcome e-mail. $this->drupalGet(user_pass_reset_url($user));