You are here

function ldapauth_admin_settings_submit in LDAP integration 6

Submit hook for the settings form.

File

./ldapauth.admin.inc, line 136
Module admin page callbacks.

Code

function ldapauth_admin_settings_submit($form, &$form_state) {
  $op = $form_state['clicked_button']['#value'];
  $values = $form_state['values'];
  switch ($op) {
    case t('Save configuration'):
      variable_set('ldapauth_login_process', $values['ldapauth_login_process']);
      variable_set('ldapauth_login_conflict', $values['ldapauth_login_conflict']);
      variable_set('ldapauth_forget_passwords', $values['ldapauth_forget_passwords']);
      variable_set('ldapauth_sync_passwords', $values['ldapauth_sync_passwords']);
      variable_set('ldapauth_disable_pass_change', $values['ldapauth_disable_pass_change']);
      variable_set('ldapauth_alter_email_field', $values['ldapauth_alter_email_field']);
      variable_set('ldapauth_create_users', $values['ldapauth_create_users']);
      variable_set('ldapauth_alter_username_field', $values['ldapauth_alter_username_field']);
      variable_set('ldapauth_debug', $values['ldapauth_debug']);
      drupal_set_message(t('The configuration options have been saved.'));
      break;
    case t('Reset to defaults'):
      variable_del('ldapauth_login_process');
      variable_del('ldapauth_login_conflict');
      variable_del('ldapauth_forget_passwords');
      variable_del('ldapauth_sync_passwords');
      variable_del('ldapauth_disable_pass_change');
      variable_del('ldapauth_alter_email_field');
      variable_del('ldapauth_create_users');
      variable_del('ldapauth_alter_username_field');
      variable_del('ldapauth_debug');
      drupal_set_message(t('The configuration options have been reset to their default values.'));
      break;
  }

  // Rebuild the menu router.
  menu_rebuild();
}