From 8c7ccce4a718ed5bf135bb690aac7c7c15fc78be Mon Sep 17 00:00:00 2001
From: "Alexander A. Klimov" <alexander.klimov@icinga.com>
Date: Tue, 16 Jan 2018 10:36:22 +0100
Subject: [PATCH] Make multi-domain authn working w/ upper-case domains in user
 names

refs #3232
---
 library/Icinga/Authentication/User/LdapUserBackend.php          | 2 +-
 .../Icinga/Authentication/UserGroup/LdapUserGroupBackend.php    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/library/Icinga/Authentication/User/LdapUserBackend.php b/library/Icinga/Authentication/User/LdapUserBackend.php
index 34a6a223b..87687fe59 100644
--- a/library/Icinga/Authentication/User/LdapUserBackend.php
+++ b/library/Icinga/Authentication/User/LdapUserBackend.php
@@ -387,7 +387,7 @@ class LdapUserBackend extends LdapRepository implements UserBackendInterface, Do
     public function authenticate(User $user, $password)
     {
         if ($this->domain !== null) {
-            if (! $user->hasDomain() || strtolower($user->getDomain()) !== $this->domain) {
+            if (! $user->hasDomain() || strtolower($user->getDomain()) !== strtolower($this->domain)) {
                 return false;
             }
 
diff --git a/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php b/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php
index 56c03b4ee..2dbbef87f 100644
--- a/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php
+++ b/library/Icinga/Authentication/UserGroup/LdapUserGroupBackend.php
@@ -683,7 +683,7 @@ class LdapUserGroupBackend extends LdapRepository implements UserGroupBackendInt
         $domain = $this->getDomain();
 
         if ($domain !== null) {
-            if (! $user->hasDomain() || strtolower($user->getDomain()) !== $domain) {
+            if (! $user->hasDomain() || strtolower($user->getDomain()) !== strtolower($domain)) {
                 return array();
             }