aboutsummaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-04-09 10:48:27 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-04-09 10:48:27 +0200
commit6d7ff2e85a97a5d9971a39c2f89f3602c4f3ac51 (patch)
tree39b128a7516dbb9ac431b670fecf68fc01fca76e /apps/user_ldap/lib
parent8177fc8aacf0d4e1f5a1fcfa7c0f845b25527429 (diff)
downloadnextcloud-server-6d7ff2e85a97a5d9971a39c2f89f3602c4f3ac51.tar.gz
nextcloud-server-6d7ff2e85a97a5d9971a39c2f89f3602c4f3ac51.zip
fix: Fix typing issues related to resource migration
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib')
-rw-r--r--apps/user_ldap/lib/Access.php16
-rw-r--r--apps/user_ldap/lib/Connection.php3
-rw-r--r--apps/user_ldap/lib/Wizard.php8
3 files changed, 1 insertions, 26 deletions
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index 70332cb1c16..7732f008a10 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -188,11 +188,6 @@ class Access extends LDAPUtility {
return false;
}
$cr = $this->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- //LDAP not available
- $this->logger->debug('LDAP resource not available.', ['app' => 'user_ldap']);
- return false;
- }
$attr = mb_strtolower($attr, 'UTF-8');
// the actual read attribute later may contain parameters on a ranged
// request, e.g. member;range=99-199. Depends on server reply.
@@ -344,11 +339,6 @@ class Access extends LDAPUtility {
throw new \Exception('LDAP password changes are disabled.');
}
$cr = $this->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- //LDAP not available
- $this->logger->debug('LDAP resource not available.', ['app' => 'user_ldap']);
- return false;
- }
try {
// try PASSWD extended operation first
return @$this->invokeLDAPMethod('exopPasswd', $userDN, '', $password) ||
@@ -1108,12 +1098,6 @@ class Access extends LDAPUtility {
) {
// See if we have a resource, in case not cancel with message
$cr = $this->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- // Seems like we didn't find any resource.
- // Return an empty array just like before.
- $this->logger->debug('Could not search, because resource is missing.', ['app' => 'user_ldap']);
- return false;
- }
//check whether paged search should be attempted
try {
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 9fafa7bf859..7c780ccbb4a 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -231,9 +231,6 @@ class Connection extends LDAPUtility {
public function getConnectionResource(): \LDAP\Connection {
if (!$this->ldapConnectionRes) {
$this->init();
- } elseif (!$this->ldap->isResource($this->ldapConnectionRes)) {
- $this->ldapConnectionRes = null;
- $this->establishConnection();
}
if (is_null($this->ldapConnectionRes)) {
$this->logger->error(
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index be83be66786..1b4c9162b71 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -645,10 +645,6 @@ class Wizard extends LDAPUtility {
}
$cr = $this->access->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- throw new \Exception('connection error');
- }
- /** @var \LDAP\Connection $cr */
if (mb_strpos($this->access->connection->ldapLoginFilter, '%uid', 0, 'UTF-8')
=== false) {
@@ -1213,9 +1209,7 @@ class Wizard extends LDAPUtility {
$dnReadCount++;
$foundItems = array_merge($foundItems, $newItems);
$dnRead[] = $dn;
- } while (($state === self::LRESULT_PROCESSED_SKIP
- || $this->ldap->isResource($entry))
- && ($dnReadLimit === 0 || $dnReadCount < $dnReadLimit));
+ } while ($dnReadLimit === 0 || $dnReadCount < $dnReadLimit);
}
}