You are here

function ldap_query_admin_form_validate in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_query/ldap_query.admin.inc \ldap_query_admin_form_validate()
  2. 7 ldap_query/ldap_query.admin.inc \ldap_query_admin_form_validate()

Validate hook for the LDAP server form.

File

ldap_query/ldap_query.admin.inc, line 67
Defines functions for administrative interface for servers

Code

function ldap_query_admin_form_validate($form, &$form_state) {
  $op = drupal_strtolower($form_state['clicked_button']['#value']);
  ldap_servers_module_load_include('php', 'ldap_query', 'LdapQueryAdmin.class');
  $server = new LdapQueryAdmin($form_state['values']['qid']);
  $errors = $server
    ->drupalFormValidate($op, $form_state['values']);
  foreach ($errors as $error_name => $error_text) {
    form_set_error($error_name, t($error_text));
  }

  // $warnings = $server->drupalFormWarnings($op, $form_state['values']);

  //foreach ($warnings as $warning_name => $warning_text) {

  // drupal_set_message($warning_text, 'warning');

  //}

  //$form_state['ldap_warnings'] = (boolean)(count($warnings) > 0);
}