Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 36499292 authored by Akhil's avatar Akhil 🙂
Browse files

Fix variable names

parent d1ad3f70
Loading
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
 		}