'ldapDefaultPPolicyDN' => null,
'ldapExtStorageHomeAttribute' => null,
'ldapMatchingRuleInChainState' => self::LDAP_SERVER_FEATURE_UNKNOWN,
+ 'ldapConnectionTimeout' => 15,
];
public function __construct(string $configPrefix, bool $autoRead = true) {
'ldap_user_avatar_rule' => 'default',
'ldap_ext_storage_home_attribute' => '',
'ldap_matching_rule_in_chain_state' => self::LDAP_SERVER_FEATURE_UNKNOWN,
+ 'ldap_connection_timeout' => 15,
];
}
'ldap_ext_storage_home_attribute' => 'ldapExtStorageHomeAttribute',
'ldap_matching_rule_in_chain_state' => 'ldapMatchingRuleInChainState',
'ldapIgnoreNamingRules' => 'ldapIgnoreNamingRules', // sysconfig
+ 'ldap_connection_timeout' => 'ldapConnectionTimeout',
];
return $array;
}
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 . '.');