You are here

function crm_core_user_sync_admin_form_submit in CRM Core 7

Same name and namespace in other branches
  1. 8.2 modules/crm_core_user_sync/crm_core_user_sync.admin.inc \crm_core_user_sync_admin_form_submit()

Submit callback. Handles synchronization changes.

File

modules/crm_core_user_sync/crm_core_user_sync.admin.inc, line 113

Code

function crm_core_user_sync_admin_form_submit($form, &$form_state) {
  $rules = variable_get('crm_core_user_sync_rules', array());
  foreach ($form_state['values']['crm_core_user_sync_rules'] as $key => $values) {
    if (!empty($values['weight'])) {
      $rules[$key]['weight'] = $values['weight'];
    }
  }
  uasort($rules, 'crm_core_user_sync_weight_cmp');
  variable_set('crm_core_user_sync_rules', $rules);
  variable_set('crm_core_user_sync_auto_sync_user_create', $form_state['values']['crm_core_user_sync_auto_sync_user_create']);
  variable_set('crm_core_user_sync_auto_sync_user_match', $form_state['values']['crm_core_user_sync_auto_sync_user_match']);
  drupal_set_message('Your changes have been saved');
}