Browse Source

Fix count on string

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
tags/v16.0.0alpha1
Daniel Kesselberg 5 years ago
parent
commit
d17b32afd7
No account linked to committer's email address
1 changed files with 15 additions and 2 deletions
  1. 15
    2
      apps/user_ldap/lib/Access.php

+ 15
- 2
apps/user_ldap/lib/Access.php View File

@@ -879,7 +879,7 @@ class Access extends LDAPUtility {
});
}
$this->batchApplyUserAttributes($recordsToUpdate);
return $this->fetchList($ldapRecords, count($attr) > 1);
return $this->fetchList($ldapRecords, $this->manyAttributes($attr));
}

/**
@@ -922,7 +922,7 @@ class Access extends LDAPUtility {
* @return array
*/
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), count($attr) > 1);
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), $this->manyAttributes($attr));
}

/**
@@ -2011,4 +2011,17 @@ class Access extends LDAPUtility {
return $pagedSearchOK;
}

/**
* Is more than one $attr used for search?
*
* @param string|string[]|null $attr
* @return bool
*/
private function manyAttributes($attr) {
if (\is_array($attr)) {
return \count($attr) > 1;
}
return false;
}

}

Loading…
Cancel
Save