From 6221a3212131667d9804d9a42bee951cab848ee4 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 14 Nov 2007 22:12:07 +0000 Subject: [PATCH] MDL-9399 auth/ldap: NTLM SSO - move textlib conversion earlier MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From Iñaki Arenaza - fix for ... I forgot to put the textlib conversion call before the block of code that uses $extusername, so it completely breaks the user validation process. --- auth/ldap/auth.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 8461b3531c..d054808317 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -85,6 +85,10 @@ class auth_plugin_ldap extends auth_plugin_base { return false; } + $textlib = textlib_get_instance(); + $extusername = $textlib->convert(stripslashes($username), 'utf-8', $this->config->ldapencoding); + $extpassword = $textlib->convert(stripslashes($password), 'utf-8', $this->config->ldapencoding); + // // Before we connect to LDAP, check if this is an AD SSO login // if we succeed in this block, we'll return success early. @@ -125,10 +129,6 @@ class auth_plugin_ldap extends auth_plugin_base { unset($key); - $textlib = textlib_get_instance(); - $extusername = $textlib->convert(stripslashes($username), 'utf-8', $this->config->ldapencoding); - $extpassword = $textlib->convert(stripslashes($password), 'utf-8', $this->config->ldapencoding); - $ldapconnection = $this->ldap_connect(); if ($ldapconnection) { -- 2.39.5