function ldap_query_admin_form_validate in Lightweight Directory Access Protocol (LDAP) 7
Same name and namespace in other branches
- 8.2 ldap_query/ldap_query.admin.inc \ldap_query_admin_form_validate()
- 7.2 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 68 - 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_server_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);
}