Skip to content

Commit

Permalink
MDL-9399 auth/ldap: NTLM SSO - move textlib conversion earlier
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinlanghoff committed Nov 14, 2007
1 parent 83cd2dc commit 6221a32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auth/ldap/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ function user_login($username, $password) {
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.
Expand Down Expand Up @@ -125,10 +129,6 @@ function user_login($username, $password) {
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) {
Expand Down

0 comments on commit 6221a32

Please sign in to comment.