Skip to content

Commit

Permalink
PHP code
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Apr 24, 2023
1 parent 2b59d27 commit 5acd3c8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,19 @@ require __DIR__ . 'vendor/autoload.php';
### LDAP connection

```php
$ldap_url = "ldap://ldap.example.com";
$ldap_starttls = false;
$dn = "cn=admin,dc=example,dc=com";
$password = "secret";
$ldap_network_timeout = 3;
$ldap_url = "ldap://ldap.example.com";
$ldap_starttls = false;
$dn = "cn=admin,dc=example,dc=com";
$password = "secret";
$ldap_network_timeout = 3;

$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $dn, $password, $ldap_network_timeout);
$ldap_connection = \Ltb\Ldap::connect($ldap_url, $ldap_starttls, $dn, $password, $ldap_network_timeout);

$ldap = $ldap_connection[0];
$result = $ldap_connection[1];
$ldap = $ldap_connection[0];
$result = $ldap_connection[1];

if( !$result ) {
exit 1;
}
if (!$result) {
error_log("Unable to connect to $ldap_url");
exit 1;
}
```

0 comments on commit 5acd3c8

Please sign in to comment.