From b13c38b65b435385709d3bae08c4d35c75910fc1 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 11 Jul 2017 17:09:24 +0200 Subject: [PATCH] Auth/Groups: Prefer the domain from the LDAP/MSAD user backend If a LDAP/MSAD user group backend is linked w/ a user backend, the domain from the user backend is preferred over the domain configured for the user group backend. --- .../Icinga/Authentication/UserGroup/LdapUserGroupBackend.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php b/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php index 480b10c46..188f7f183 100644 --- a/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php +++ b/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php @@ -781,7 +781,8 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt 'user_base_dn' => $userBackend->getBaseDn(), 'user_class' => $userBackend->getUserClass(), 'user_name_attribute' => $userBackend->getUserNameAttribute(), - 'user_filter' => $userBackend->getFilter() + 'user_filter' => $userBackend->getFilter(), + 'domain' => $userBackend->getDomain() )); } @@ -796,7 +797,7 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt ->setGroupFilter($config->group_filter) ->setUserFilter($config->user_filter) ->setNestedGroupSearch((bool) $config->get('nested_group_search', $defaults->nested_group_search)) - ->setDomain($config->domain); + ->setDomain($defaults->get('domain', $config->domain)); } /**