]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9399 auth/ldap: NTLM SSO - move textlib conversion earlier
authormartinlanghoff <martinlanghoff>
Wed, 14 Nov 2007 22:12:07 +0000 (22:12 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 14 Nov 2007 22:12:07 +0000 (22:12 +0000)
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

index 8461b3531cb6f9a6baf274909e13749f6d3f6bff..d054808317e405e0a208feb0d8258121fbca385f 100644 (file)
@@ -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) {