fix: Use a CappedMemoryCache instead of an array to cache stuff in user_ldap

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/59002/head
Côme Chilliet 5 months ago
parent 18dddbc3b5
commit 0887810eb9
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
  1. 4
      apps/user_ldap/lib/Access.php

@ -16,6 +16,7 @@ use OCA\User_LDAP\Exceptions\NoMoreResults;
use OCA\User_LDAP\Mapping\AbstractMapping;
use OCA\User_LDAP\User\Manager;
use OCA\User_LDAP\User\OfflineUser;
use OCP\Cache\CappedMemoryCache;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\HintException;
use OCP\IAppConfig;
@ -49,7 +50,7 @@ class Access extends LDAPUtility {
protected $groupMapper;
private string $lastCookie = '';
private array $intermediates = [];
private CappedMemoryCache $intermediates;
public function __construct(
ILDAPWrapper $ldap,
@ -63,6 +64,7 @@ class Access extends LDAPUtility {
) {
parent::__construct($ldap);
$this->userManager->setLdapAccess($this);
$this->intermediates = new CappedMemoryCache();
}
/**

Loading…
Cancel
Save