Skip to content

Commit

Permalink
Maak het mogelijk om TLS in LDAP uit te zetten
Browse files Browse the repository at this point in the history
  • Loading branch information
qurben committed Oct 28, 2023
1 parent 9577f4b commit 8a9f581
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ LDAP_HOST=
LDAP_PORT=
LDAP_BINDDN=cn=admin,dc=csrdelft,dc=nl
LDAP_PASSWD=
LDAP_TLS=true
LDAP_BASE=dc=csrdelft,dc=nl
LDAP_BASE_LEDEN=ou=leden,dc=csrdelft,dc=nl
LDAP_BASE_GROEPEN=ou=groepen,dc=csrdelft,dc=nl
Expand Down
4 changes: 3 additions & 1 deletion lib/common/LDAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public function connect($dobind)
}
$conn = ldap_connect($_ENV['LDAP_HOST'], (int) $_ENV['LDAP_PORT']);
ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_start_tls($conn);
if ($_ENV['LDAP_TLS'] == "true") {
ldap_start_tls($conn);
}
if ($dobind === true) {
$bind = ldap_bind($conn, $_ENV['LDAP_BINDDN'], $_ENV['LDAP_PASSWD']);
if ($bind !== true) {
Expand Down

0 comments on commit 8a9f581

Please sign in to comment.