mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-27 07:44:05 +02:00
ImportSourceLdap: allow to fetch dn as a column
This commit is contained in:
parent
5b3b5cbfb8
commit
2a173b7cd3
@ -13,7 +13,9 @@ class ImportSourceLdap extends ImportSourceHook
|
||||
|
||||
public function fetchData()
|
||||
{
|
||||
$query = $this->connection()->select()->from($this->settings['objectclass'], $this->listColumns());
|
||||
$columns = $this->listColumns();
|
||||
$query = $this->connection()->select()->from($this->settings['objectclass'], $columns);
|
||||
|
||||
if ($base = $this->settings['base']) {
|
||||
$query->setBase($base);
|
||||
}
|
||||
@ -21,7 +23,16 @@ class ImportSourceLdap extends ImportSourceHook
|
||||
$query->setNativeFilter($filter);
|
||||
}
|
||||
|
||||
return $query->fetchAll();
|
||||
if (in_array('dn', $columns)) {
|
||||
$result = $query->fetchAll();
|
||||
foreach ($result as $dn => $row) {
|
||||
$row->dn = $dn;
|
||||
}
|
||||
|
||||
return $result;
|
||||
} else {
|
||||
return $query->fetchAll();
|
||||
}
|
||||
}
|
||||
|
||||
public function listColumns()
|
||||
|
Loading…
x
Reference in New Issue
Block a user