[icinga-checkins] icinga.org: icinga-web/master: * HTTP auth now works with lowercase names ( fixes #2273)

git at icinga.org git at icinga.org
Wed Apr 18 16:21:52 CEST 2012


Module: icinga-web
Branch: master
Commit: a49496c7f4aa16778b3362f5b31e564dda280243
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=a49496c7f4aa16778b3362f5b31e564dda280243

Author: Jannis Mosshammer <jannis.mosshammer at netways.de>
Date:   Wed Apr 18 16:21:23 2012 +0200

* HTTP auth now works with lowercase names (fixes #2273)

---

 .../HTTPBasicAuthenticationModel.class.php         |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/modules/AppKit/models/Auth/Provider/HTTPBasicAuthenticationModel.class.php b/app/modules/AppKit/models/Auth/Provider/HTTPBasicAuthenticationModel.class.php
index e162fea..ba6b4a3 100644
--- a/app/modules/AppKit/models/Auth/Provider/HTTPBasicAuthenticationModel.class.php
+++ b/app/modules/AppKit/models/Auth/Provider/HTTPBasicAuthenticationModel.class.php
@@ -28,8 +28,13 @@ class AppKit_Auth_Provider_HTTPBasicAuthenticationModel extends AppKitAuthProvid
 
     public function doAuthenticate(NsmUser $user, $password, $username=null, $authid=null) {
         $tuser = $this->loadUserByDQL($user->user_name);
-
-        if ($tuser && $tuser instanceof NsmUser && $user->user_name == $this->getAuthName()) {
+        $username = $user->user_name;
+        $authname = $this->getAuthName();
+        if($this->getParameter('auth_lowercase_username',false) == true) {
+            $username = strtolower($username);
+            $authname = strtolower($authname);
+        }
+        if ($tuser && $tuser instanceof NsmUser && $username == $authname) {
             return true;
         }
 





More information about the icinga-checkins mailing list