You are here

function ldap_profile_admin_form_submit in Lightweight Directory Access Protocol (LDAP) 7

submit handler function for ldap_profile_admin_form

File

ldap_profile/ldap_profile.admin.inc, line 38
Administrative page callbacks for the ldap_profile module.

Code

function ldap_profile_admin_form_submit($form, &$form_state) {
  require_once 'LdapProfileConfAdmin.class.php';
  $auth_conf = new LdapProfileConfAdmin();
  $auth_conf
    ->drupalFormSubmit($form_state['values']);

  // add form data to object and save or create
  if ($auth_conf->hasError == FALSE) {
    drupal_set_message(t('LDAP Profile configuration saved'), 'status');
    drupal_goto(LDAP_SERVERS_MENU_BASE_PATH . '/profile');
  }
  else {
    form_set_error($auth_conf->errorName, $auth_conf->errorMsg);
    $auth_conf
      ->clearError();
  }
}