Loading patches/023-ldap-check-pwd-optimization.patch +3 −3 Original line number Diff line number Diff line Loading @@ -9,13 +9,13 @@ Subject: [PATCH] This patch optimize the ldap checkPassword function to reduce n * @throws \Exception */ - public function loginName2UserName($loginName) { + public function loginName2UserName($loginName, bool $overrideCacheIfFalse = false) { + public function loginName2UserName($loginName, bool $ignoreCacheIfFalseFound = false) { $cacheKey = 'loginName2UserName-' . $loginName; $username = $this->access->connection->getFromCache($cacheKey); - if ($username !== null) { + $overrideCache = $overrideCacheIfFalse && $username === false; + if ($username !== null && !$overrideCache) { + $forceLdapFetch = ($username === false && $ignoreCacheIfFalseFound); + if ($username !== null && !$forceLdapFetch) { return $username; } Loading Loading
patches/023-ldap-check-pwd-optimization.patch +3 −3 Original line number Diff line number Diff line Loading @@ -9,13 +9,13 @@ Subject: [PATCH] This patch optimize the ldap checkPassword function to reduce n * @throws \Exception */ - public function loginName2UserName($loginName) { + public function loginName2UserName($loginName, bool $overrideCacheIfFalse = false) { + public function loginName2UserName($loginName, bool $ignoreCacheIfFalseFound = false) { $cacheKey = 'loginName2UserName-' . $loginName; $username = $this->access->connection->getFromCache($cacheKey); - if ($username !== null) { + $overrideCache = $overrideCacheIfFalse && $username === false; + if ($username !== null && !$overrideCache) { + $forceLdapFetch = ($username === false && $ignoreCacheIfFalseFound); + if ($username !== null && !$forceLdapFetch) { return $username; } Loading