You are here

private function ServerTestForm::testConnection in Lightweight Directory Access Protocol (LDAP) 8.4

Same name and namespace in other branches
  1. 8.3 ldap_servers/src/Form/ServerTestForm.php \Drupal\ldap_servers\Form\ServerTestForm::testConnection()

Test the connection.

1 call to ServerTestForm::testConnection()
ServerTestForm::submitForm in ldap_servers/src/Form/ServerTestForm.php
This is the default entity object builder function. It is called before any other submit handler to build the new entity object to be used by the following submit handlers. At this point of the form workflow the entity is validated and the form state…

File

ldap_servers/src/Form/ServerTestForm.php, line 762

Class

ServerTestForm
Use Drupal\Core\Form\FormBase;.

Namespace

Drupal\ldap_servers\Form

Code

private function testConnection() : void {
  if (!$this->ldapBridge
    ->bind()) {
    $this->resultsTables['basic'][] = [
      'class' => 'color-error',
      'data' => [
        $this
          ->t('Failed to connect and bind to LDAP server, see logs for details.'),
      ],
    ];
    $this->exception = TRUE;
  }
}