問題:AD使用者可以順利登入xoops,不過在抓取AD使用者姓名欄位時,可能因為Windows語系的問題,在xoops顯示的使用者姓名是亂碼。
解決:修改紅色程式碼
//$xoopsUser->setVar(trim($fields[0]), utf8_decode($datas[trim($fields[1])][0]));
$xoopsUser->setVar(trim($fields[0]), $datas[trim($fields[1])][0]);
function change(&$xoopsUser, $datas, $uname, $pwd = null)
{
$ret = false;
$member_handler =& xoops_gethandler('member');
$xoopsUser->setVar('pass', md5(stripslashes($pwd)));
$tab_mapping = explode('|', $this->ldap_field_mapping);
foreach ($tab_mapping as $mapping) {
$fields = explode('=', trim($mapping));
if ($fields[0] && $fields[1]) {
//$xoopsUser->setVar(trim($fields[0]), utf8_decode($datas[trim($fields[1])][0]));
$xoopsUser->setVar(trim($fields[0]), $datas[trim($fields[1])][0]);
}
}
if ($member_handler->insertUser($xoopsUser)) {
return $xoopsUser;
} else {
redirect_header(XOOPS_URL . '/user.php', 5, $xoopsUser->getHtmlErrors());
}
沒有留言:
張貼留言