public function ServerTestForm::testBinding in Lightweight Directory Access Protocol (LDAP) 8.3
Helper function to bind as required for testing.
1 call to ServerTestForm::testBinding()
- ServerTestForm::testConnection in ldap_servers/
src/ Form/ ServerTestForm.php - Test the connection.
File
- ldap_servers/
src/ Form/ ServerTestForm.php, line 607
Class
Namespace
Drupal\ldap_servers\FormCode
public function testBinding() {
if ($this
->config('')) {
$bindResult = $this->ldapServer
->bind();
}
if ($bindResult == Server::LDAP_SUCCESS) {
$this->resultsTables['basic'][] = [
'class' => 'color-success',
'data' => [
$this
->t('Successfully bound to server'),
],
];
}
else {
$this->resultsTables['basic'][] = [
'class' => 'color-error',
'data' => [
$this
->t('Failed to bind with service account. LDAP error: @error', [
'@error' => $this->ldapServer
->formattedError($bindResult),
]),
],
];
$this->exception = TRUE;
}
}