1. drupal 中配置LDAP(配置server),能够成功的登陆后。配置AUthorization 。
2. 配置过程: (1)首先选择你配置的server名称
(2) 将 ENable this congfiguration和 only apply the following。。这两个选项选好
(3) Part 二中只选择A项,将drupal role is derived from user‘s DN 选中,并且在框中添加ou
其余的B和C不用选
(4) Part 三也不用填写
(5) Part 四B中选第一个 when a user logs on
(6)Part四C全选
这样就配置好了堆填好的进行test出现例如“\\E5\\88\\98\\E5\\86\\B0”的乱码
出错原因:drupal/sites/all/modules/ldap/ldap_authorization/ldap_authorization.inc
中的第366中的ldap_explode_dn(),将传入的数据进行了处理,产生了乱码,如果出现这个错误你可以先查看手册中队ldap_explode_dn()的
用法。
我的解决方法就是在377行也就是调用ldap_explode_dn()函数的下一行添加如下代码:
foreach($pairs as $key=>$value){
$pairs[$key]=preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $value);
}
接解决了,如有不明白可以给我留言