我的井字字符有LDAP身份验证问题,我尝试使用:
$password = utf8_decode($password);
或
$password = mb_convert_encoding($_POST["password"], "UTF-8");
但是不行!
这是我的功能:
function authenticate($user, $password) {
if(empty($user) || empty($password)) return false;
$ldap_host_dcf = "xxxx.xx";
$ldap_dcf = ldap_connect($ldap_host_dcf);
ldap_set_option($ldap_dcf, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldap_dcf, LDAP_OPT_REFERRALS, 0);
if($bind_dcf = @ldap_bind($ldap_dcf, $user.$ldap_usr_dom, $password)) {
return true;
}