You are here

public function LdapServerAdmin::drupalFormValidate in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_servers/LdapServerAdmin.class.php \LdapServerAdmin::drupalFormValidate()
  2. 7 ldap_servers/LdapServerAdmin.class.php \LdapServerAdmin::drupalFormValidate()

File

ldap_servers/LdapServerAdmin.class.php, line 315

Class

LdapServerAdmin

Code

public function drupalFormValidate($op, $values) {
  $errors = array();
  if ($op == 'delete') {
    if (!$this->sid) {
      $errors['server_id_missing'] = 'Server id missing from delete form.';
    }
    $warnings = module_invoke_all('ldap_server_in_use', $this->sid, $this->name);
    if (count($warnings)) {
      $errors['status'] = join("<br/>", array_values($warnings));
    }
  }
  else {
    $this
      ->populateFromDrupalForm($op, $values);
    $errors = $this
      ->validate($op);
  }
  return $errors;
}