mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
LdapConnection: Fix that fetchColumn() returns results unordered
This commit is contained in:
parent
ca112af9ad
commit
6ff15acc1b
@ -374,12 +374,13 @@ class LdapConnection implements Selectable
|
||||
$fields = $query->getColumns();
|
||||
}
|
||||
|
||||
$column = current($fields);
|
||||
if (! $column) {
|
||||
if (empty($fields)) {
|
||||
throw new ProgrammingError('You must request at least one attribute when fetching a single column');
|
||||
}
|
||||
|
||||
$results = $this->fetchAll($query, array($column));
|
||||
$alias = key($fields);
|
||||
$results = $this->fetchAll($query, array($alias => current($fields)));
|
||||
$column = is_int($alias) ? current($fields) : $alias;
|
||||
$values = array();
|
||||
foreach ($results as $row) {
|
||||
if (isset($row->$column)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user