Index: og_defaults.module
===================================================================
36a37,61
>     // Membership requests restriction
>     // increment the array keys because checkboxes seems to ignore 0 key
>     $tmp_membership_requests_type = og_selective_map();
>     $i = 1;
>     $j = 0;
>     
>     for ($i, $j; $j < count($tmp_membership_requests_type); $i++, $j++) {
>         $membership_requests_type[$i] = $tmp_membership_requests_type[$j];
>     }
>     
>     $form['og']['og_defaults_settings']['og_membership_requests_restriction'] = array(
>       '#type' => 'fieldset',
>       '#title' => t('Membership requests restriction'),
>       '#collapsible' => TRUE,
>       '#collapsed' => TRUE
>     );
> 
>     $form['og']['og_defaults_settings']['og_membership_requests_restriction']['og_membership_requests_restriction'] = array(
>       '#type' => 'checkboxes',
>       '#title' => t('Membership requests restriction'),
>       '#default_value' => variable_get('og_membership_requests_restriction_'. $type, array()),
>       '#options' => $membership_requests_type,
>       '#description' => t('Select only the membership request types you want to leave available. Leave blank do not change the original behavior. <strong>Make sure that the following default value is included in the types chosen</strong>')
>     );
>     
275a301
> 
282a309,331
>   
>   // Built in content types do not allow changes to type machine name.
>   if (isset($form['identity']['type']['#default_value'])) {
>     $type = $form['identity']['type']['#default_value'];
>   }
>   else {
>     $type = $form['identity']['type']['#value'];
>   }
> 
>   if (og_is_group_type($type)) {
>     
>     if(array_sum($form_state['values']['og_membership_requests_restriction']) > 0 && $form_state['values']['og_selective_enforce'] == 1) {
>       form_set_error('og][og_defaults_settings][og_membership_requests_restriction', 'If you enforce the "Membership request" type, the type restriction is not necessary');
>       drupal_goto('admin/content/node-type/' . $type);
>     }
> 
>     if(array_sum($form_state['values']['og_membership_requests_restriction']) > 0 && !empty($form_state['values']['og_membership_requests_restriction']) && !in_array($form_state['values']['og_selective'] + 1, $form_state['values']['og_membership_requests_restriction'])) {
>       form_set_error('og][og_defaults_settings][og_membership_requests_restriction', 'The default "Membership requests" type is not within the allowed types');
>       drupal_goto('admin/content/node-type/' . $type);
>     }
>     
>   }
> 
294c343,344
< 
---
>       //OG Membership requests restriction
>       $og_membership_requests_restriction = variable_get('og_membership_requests_restriction_'. $node->type, array());
325a376,388
>         
>         if(!empty($og_membership_requests_restriction)) {
>           
>           foreach($form['og_selective']['#options'] as $key => $value) {
>             
>             if(!in_array($key + 1, $og_membership_requests_restriction)) {
>               unset($form['og_selective']['#options'][$key]);
>             }
>             
>           }
> 
>         }
>         
