diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php index 8461b3531cb6f..d054808317e40 100644 --- a/auth/ldap/auth.php +++ b/auth/ldap/auth.php @@ -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. @@ -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) {