mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
chore(user_ldap): Move static var to static property and silence warning
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
54be8ca769
commit
68f417b354
1 changed files with 5 additions and 3 deletions
|
|
@ -139,6 +139,9 @@ class Connection extends LDAPUtility {
|
|||
protected LoggerInterface $logger;
|
||||
private IL10N $l10n;
|
||||
|
||||
/** @psalm-suppress ImpureStaticProperty This is a cache for whether php-ldap is installed, which cannot change mid-process */
|
||||
private static bool $phpLDAPinstalled = true;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param string $configPrefix a string with the prefix for the configkey column (appconfig table)
|
||||
|
|
@ -589,8 +592,7 @@ class Connection extends LDAPUtility {
|
|||
if (!$this->configuration->ldapConfigurationActive) {
|
||||
return null;
|
||||
}
|
||||
static $phpLDAPinstalled = true;
|
||||
if (!$phpLDAPinstalled) {
|
||||
if (!static::$phpLDAPinstalled) {
|
||||
return false;
|
||||
}
|
||||
if (!$this->ignoreValidation && !$this->configured) {
|
||||
|
|
@ -602,7 +604,7 @@ class Connection extends LDAPUtility {
|
|||
}
|
||||
if (!$this->ldapConnectionRes) {
|
||||
if (!$this->ldap->areLDAPFunctionsAvailable()) {
|
||||
$phpLDAPinstalled = false;
|
||||
static::$phpLDAPinstalled = false;
|
||||
$this->logger->error(
|
||||
'function ldap_connect is not available. Make sure that the PHP ldap module is installed.',
|
||||
['app' => 'user_ldap']
|
||||
|
|
|
|||
Loading…
Reference in a new issue