Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix count on string
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb authored and Backportbot committed Nov 27, 2018
commit 943f2576c578d556ee6e5fa77bfef16ab8efb515
17 changes: 15 additions & 2 deletions apps/user_ldap/lib/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null,
});
}
$this->batchApplyUserAttributes($recordsToUpdate);
return $this->fetchList($ldapRecords, count($attr) > 1);
return $this->fetchList($ldapRecords, $this->manyAttributes($attr));
}

/**
Expand Down Expand Up @@ -922,7 +922,7 @@ public function batchApplyUserAttributes(array $ldapRecords){
* @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));
}

/**
Expand Down Expand Up @@ -2011,4 +2011,17 @@ private function initPagedSearch($filter, $bases, $attr, $limit, $offset) {
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;
}

}