? 313629_anon_user.patch
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.40.2.23
diff -u -p -r1.40.2.23 domain.module
--- domain.module	18 Sep 2008 13:48:11 -0000	1.40.2.23
+++ domain.module	26 Sep 2008 19:59:52 -0000
@@ -275,6 +275,11 @@ function domain_block($op = 'list', $del
  */
 function domain_user($op, &$edit, &$account, $category = NULL) {
   switch ($op) {
+    case 'load':
+      if($account->uid == 0) {
+        $account->domain_user = variable_get('domain_anonymous_user', array(-1));
+      }
+      break;
     case 'form':
     case 'register':
       if (is_null($category) || $category == 'account') {
@@ -303,7 +308,7 @@ function domain_user($op, &$edit, &$acco
           $form['domain_user']['domain_user'] = array(
             '#type' => 'checkboxes',
             '#options' => $options,
-            '#title' => t('Domain access setttings'),
+            '#title' => t('Domain access settings'),
             '#description' => t('Select the affiliates that this user belongs to.  Used to grant editing permissions for users with the "edit domain nodes" permission.'),
             '#default_value' => $default
           );
@@ -1083,6 +1088,11 @@ function domain_form_alter($form_id, &$f
         $action = variable_get('domain_options', 0);
         $user_domains = array();
         $default_options = array();
+        // If this is the anonymous user, load the full $user object so we know
+        // what domain publishing options they have.
+        if ($user->uid == 0) {
+          $user = user_load(array('uid' => 0));
+        }
         foreach ($user->domain_user as $key => $value) {
           if (abs($value) > 0) {
             $user_domains[] = $value;
Index: domain_admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/Attic/domain_admin.inc,v
retrieving revision 1.29.2.11
diff -u -p -r1.29.2.11 domain_admin.inc
--- domain_admin.inc	11 Sep 2008 13:35:21 -0000	1.29.2.11
+++ domain_admin.inc	26 Sep 2008 19:59:53 -0000
@@ -211,6 +211,30 @@ function domain_configure_form($user_sub
     '#description' => t('Controls the display of domain lists to end users.')
   );
 
+  $form['domain_anonymous_user'] = array(
+    '#type' => 'fieldset',
+    '#title' => 'Domains that accept anonymous content',
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE
+  );
+
+  // Create a list of domains for the domain_anonymous_user checkboxes.
+  $options = array();
+  foreach (domain_domains() as $data) {
+    $options[$data['domain_id']] = $data['sitename'];
+  }
+  // The first option (default domain) needs to be -1, not 0.
+  $options[-1] = $options[0];
+  unset($options[0]);
+  ksort($options);
+
+  $form['domain_anonymous_user']['domain_anonymous_user'] = array(
+    '#type' => 'checkboxes',
+    '#options' => $options,
+    '#description' => t('Select the affiliates that anonymous users may post content to. If no domains are selected here, anonymous users may not post content on the site, even if they otherwise have permission.'),
+    '#default_value' => variable_get('domain_anonymous_user', array(-1)),
+  );
+
   $form['domain_advanced'] = array(
     '#type' => 'fieldset',
     '#title' => t('Advanced settings'),
