diff options
author | Louis Chemineau <louis@chmn.me> | 2022-11-23 11:37:49 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2022-11-23 11:37:49 +0100 |
commit | a781ae3afb270af8cef33766ecc03f7d19670f12 (patch) | |
tree | 1a8a156367ffe49241f124ab77ee220e517cdfa9 /apps/user_ldap/lib/Connection.php | |
parent | 9422d80f882b99d56fb9edb3c7bd1f3758e9cb1f (diff) | |
download | nextcloud-server-a781ae3afb270af8cef33766ecc03f7d19670f12.tar.gz nextcloud-server-a781ae3afb270af8cef33766ecc03f7d19670f12.zip |
Allow to set a custom timeout for ldap connections
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/user_ldap/lib/Connection.php')
-rw-r--r-- | apps/user_ldap/lib/Connection.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php index 89b58b7ebfd..ab301cde5b5 100644 --- a/apps/user_ldap/lib/Connection.php +++ b/apps/user_ldap/lib/Connection.php @@ -649,6 +649,10 @@ class Connection extends LDAPUtility { throw new ServerNotAvailableException('Could not disable LDAP referrals.'); } + if (!$this->ldap->setOption($this->ldapConnectionRes, LDAP_OPT_NETWORK_TIMEOUT, $this->configuration->ldapConnectionTimeout)) { + throw new ServerNotAvailableException('Could not set network timeout'); + } + if ($this->configuration->ldapTLS) { if (!$this->ldap->startTls($this->ldapConnectionRes)) { throw new ServerNotAvailableException('Start TLS failed, when connecting to LDAP host ' . $host . '.'); |