You are here

function ldapauth_admin_options_submit in LDAP integration 5

Same name and namespace in other branches
  1. 5.2 ldapauth.module \ldapauth_admin_options_submit()

File

./ldapauth.module, line 379

Code

function ldapauth_admin_options_submit($form_id, $form_values) {
  if ($form_values['ldap_restore_defaults']) {
    variable_del('ldap_disable_request_new_password');
    variable_del('ldap_alter_reset_form');
    variable_del('ldap_alter_email_field');
    variable_del('ldap_user_pass_form');
    variable_del('ldap_disable_user_request_password');
    variable_del('ldap_forget_passwords');
    variable_del('ldap_login_process');
    $msg = 'System wide LDAP settings reset to defaults';
  }
  else {
    variable_set('ldap_user_pass_form', $form_values['ldap_user_pass_form']);
    variable_set('ldap_disable_request_new_password', $form_values['ldap_disable_request_new_password']);
    variable_set('ldap_forget_passwords', $form_values['ldap_forget_passwords']);
    variable_set('ldap_login_process', $form_values['ldap_login_process']);
    variable_set('ldap_disable_user_request_password', $form_values['ldap_disable_user_request_password']);
    variable_set('ldap_alter_reset_form', $form_values['ldap_alter_reset_form']);
    variable_set('ldap_alter_email_field', $form_values['ldap_alter_email_field']);
    $msg = 'System wide LDAP settings saved';
  }
  drupal_set_message($msg);
  return 'admin/settings/ldapauth/options';
}