? 6-validate.patch
? 6-x-conf-ignore.patch
? 683400-redirect.patch
? 710712-dc.patch
? 745540-lang.patch
? 755456-settings-backport.patch
? 757746-domain-content.patch
? 758772-sitename.patch
? 762686-remove.patch
? 762686-remove2.patch
? test.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/README.txt,v
retrieving revision 1.72.2.1
diff -u -p -r1.72.2.1 README.txt
--- README.txt	11 Jan 2010 16:36:27 -0000	1.72.2.1
+++ README.txt	5 Apr 2010 19:53:21 -0000
@@ -59,7 +59,8 @@ CONTENTS
 4.8.2   Domain Node Types
 4.9   Batch Updating
 4.10  Assigning Users to Domains
-4.11 Batch Assignment of Users to Domains
+4.11  Batch Assignment of Users to Domains
+4.11.1  Form Behavior
 5.  Blocks
 5.1   Block -- Domain Switcher
 5.2   Block -- Domain Access Information
@@ -1062,6 +1063,25 @@ currently assigned to.
 If these elements do not appear, you do not have the proper permissions.
 
 ----
+4.11.1 Form Behavior
+
+In 6.x.2.5 and higher, you may select one of two options when updating domains.
+
+Under the 'Update behavior' form element, you may choose:
+
+  [] Replace old values with new settings
+  [] Add new settings to existing values
+  [] Remove selected domains from existing values
+
+Choosing 'replace' will erase any current domain affiliation for the selected users
+and replace them with those entered into the form. Choosing 'add' will merge the
+new values with the existing values. Choosing 'remove' will remove the new values
+from the existing ones.
+
+This new feature is helpful when you want to alter domain settings, but do not
+want all users to be assigned to the same domains.
+
+----
 5.  Blocks
 
 The Domain Access module provides two blocks, which can be used to help you
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.134.2.14
diff -u -p -r1.134.2.14 domain.module
--- domain.module	30 Mar 2010 13:47:00 -0000	1.134.2.14
+++ domain.module	5 Apr 2010 19:53:24 -0000
@@ -498,6 +498,13 @@ function domain_form_user_admin_account_
     '#prefix' => '<div class="description">'. t('If you select <em>Assign users to domains</em> above, you should confirm the <em>Affiliate editor options</em> settings below.') .'</div>',
     '#weight' => -1,
   );
+  $form['domain']['behavior'] = array(
+    '#type' => 'radios',
+    '#title' => t('Update behavior'),
+    '#options' => array(0 => t('Replace old values with new settings'), 1 => t('Add new settings to existing values'), 2 => t('Remove selected domains from existing values')),
+    '#description' => t('Defines how new grants will be applied to the updated users.'),
+    '#default_value' => 0,
+  );
   $form['domain']['domains'] = array(
     '#type' => empty($format) ? 'checkboxes' : 'select',
     '#title' => t('Assign to'),
@@ -557,9 +564,32 @@ function domain_update_users($form, &$fo
   if ($values['operation'] != 'domain') {
     return;
   }
+  // Get the domains for this user, but ignore roles unless told to use them.
+  $add_roles = variable_get('domain_add_roles', 0);
+  // Loop through the selected accounts.
+  $domains = array_filter($values['domains']);
   foreach ($values['accounts'] as $uid) {
+    // If appending values, do so here.
+    if (!empty($form_state['values']['behavior'])) {
+      $account = new stdClass();
+      $account->uid = $uid;
+      $current = domain_get_user_domains($account, $add_roles, TRUE);
+      // Behavior 1: add new domains.
+      if ($form_state['values']['behavior'] == 1) {
+        $domains += $current;
+      }
+      // Behavior 2: remove new domains.
+      else {
+        foreach ($domains as $domain_id) {
+          if (isset($current[$domain_id])) {
+            unset($current[$domain_id]);
+          }
+        }
+        $domains = $current;
+      }
+    }
     db_query("DELETE FROM {domain_editor} WHERE uid = %d", $uid);
-    foreach (array_filter($values['domains']) as $domain_id) {
+    foreach ($domains as $domain_id) {
       // Cannot use 0 as a checkbox.
       if ($domain_id == -1) {
         $domain_id = 0;
Index: domain_content/README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/README.txt,v
retrieving revision 1.8.2.1
diff -u -p -r1.8.2.1 README.txt
--- domain_content/README.txt	31 Jan 2010 21:47:06 -0000	1.8.2.1
+++ domain_content/README.txt	5 Apr 2010 19:53:24 -0000
@@ -22,6 +22,7 @@ CONTENTS
 4.  Content Editing
 4.1   Affiliates
 4.2   Domain Access Options
+4.3   Form Behavior
 5.  Developer Notes
 
 
@@ -146,10 +147,29 @@ By default, the currently active domain 
 promoting new nodes to all affiliates.
 
 WARNING: It is possible that you may move some nodes to domains other
-than the currently active domain.  If so, some nodes will be reomved from
+than the currently active domain.  If so, some nodes will be removed from
 the form after you submit the update.  This behavior is normal and desired.
 
 ----
+4.3 Form Behavior
+
+In 6.x.2.5 and higher, you may select one of two options when updating domains.
+
+Under the 'Update behavior' form element, you may choose:
+
+  [] Replace old values with new settings
+  [] Add new settings to existing values
+  [] Remove selected domains from existing values
+
+Choosing 'replace' will erase any current domain affiliation for the selected nodes
+and replace them with those entered into the form. Choosing 'add' will merge the
+new values with the existing values. Choosing 'remove' will remove the new values
+from the existing ones.
+
+This new feature is helpful when you want to alter domain settings, but do not
+want all nodes to be assigned to the same affiliates.
+
+----
 5.  Developer Notes
 
 A companion module that handles this function for Comments is also needed.
Index: domain_content/domain_content.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/domain_content.admin.inc,v
retrieving revision 1.15.2.4
diff -u -p -r1.15.2.4 domain_content.admin.inc
--- domain_content/domain_content.admin.inc	5 Apr 2010 18:13:45 -0000	1.15.2.4
+++ domain_content/domain_content.admin.inc	5 Apr 2010 19:53:25 -0000
@@ -255,6 +255,13 @@ function domain_content_form($form_state
       '#collapsed' => TRUE,
       '#prefix' => '<div class="description">'. t('If you select <em>Change affiliate publishing options</em> above, you should confirm the <em>Affiliate publishing options</em> settings below.') .'</div>'
     );
+    $form['domain']['behavior'] = array(
+      '#type' => 'radios',
+      '#title' => t('Update behavior'),
+      '#options' => array(0 => t('Replace old values with new settings'), 1 => t('Add new settings to existing values'), 2 => t('Remove selected domains from existing values')),
+      '#description' => t('Defines how new grants will be applied to the updated nodes.'),
+      '#default_value' => 0,
+    );
     $form['domain']['domain_site'] = array(
       '#type' => 'checkbox',
       '#prefix' => t('<p><b>Publishing options:</b>'),
@@ -371,6 +378,30 @@ function domain_content_update_nodes($fo
     }
     // Make sure the node is valid.
     if ($node->nid > 0) {
+      // If modifying values, do so here.
+      if (!empty($form_state['values']['behavior'])) {
+        $current = domain_get_node_domains($node->nid);
+        // Add values to the current set.
+        if ($form_state['values']['behavior'] == 1) {
+          if (!empty($current['domain_site'])) {
+            $domain_site = TRUE;
+          }
+          $domains += $current['domain_id'];
+        }
+        // Remove values from the current set.
+        else {
+          foreach ($domains as $domain_id) {
+            if (isset($current['domain_id'][$domain_id])) {
+              unset($current['domain_id'][$domain_id]);
+            }
+          }
+          $domains = $current['domain_id'];
+          // If all affiliates is selected, remove it.
+          if ($domain_site) {
+            $domain_site = FALSE;
+          }
+        }
+      }
       // Use our new options, as set above.
       $node->domain_site = $domain_site;
       $node->domains = $domains;
