? all_og_types_patch.txt
? require_num_groups_1.diff
? rquire_num_groups_1.diff
Index: og_mandatory_group.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/og_mandatory_group/og_mandatory_group.module,v
retrieving revision 1.4.2.1
diff -u -p -r1.4.2.1 og_mandatory_group.module
--- og_mandatory_group.module	22 Jul 2006 12:40:59 -0000	1.4.2.1
+++ og_mandatory_group.module	23 Sep 2006 21:23:23 -0000
@@ -13,12 +13,27 @@ function og_mandatory_group_help($sectio
    }
 }
 
+
+function og_mandatory_group_registration_validate($form_id, $form_values, $form) {
+  unset($form_values['og_register'][0]);
+  if (count(array_filter($form_values['og_register'])) < 1) {
+    form_set_error('og_register',"You must join at least one group");
+  }
+}
+
 /**
  * Implementation of hook_user
  * 
  */
 function og_mandatory_group_user($op, &$edit, &$account, $category = NULL) {
   switch ($op) {
+    
+    case 'register':
+      $form['#validate'] = array(
+            'og_mandatory_group_registration_validate' => array());
+      $form['og_register']['minimum'] = array ('#value' => t('You must join at least one group.'),);
+      return $form;
+      break;
     case 'insert':
       if (($group = variable_get('og_mandatory_group', 0)) != 0) {
         og_save_subscription($group, $account->uid, array('is_active' => 1));
