Fix bug where hidden ldap addressbooks would still be visible (Bifrost#T171965)

This commit is contained in:
Aleksander Machniak 2019-01-07 13:04:55 +00:00
parent 618fbe9b35
commit 315079c8e4

View file

@ -204,8 +204,9 @@ class kolab_addressbook extends rcube_plugin
$jsdata = array(); $jsdata = array();
$sources = (array)$this->rc->get_address_sources(); $sources = (array)$this->rc->get_address_sources();
// list all non-kolab sources first // list all non-kolab sources first (also exclude hidden sources)
foreach (array_filter($sources, function($source){ return empty($source['kolab']); }) as $j => $source) { $filter = function($source){ return empty($source['kolab']) && empty($source['hidden']); };
foreach (array_filter($sources, $filter) as $j => $source) {
$id = strval(strlen($source['id']) ? $source['id'] : $j); $id = strval(strlen($source['id']) ? $source['id'] : $j);
$out .= $this->addressbook_list_item($id, $source, $jsdata) . '</li>'; $out .= $this->addressbook_list_item($id, $source, $jsdata) . '</li>';
} }