dongqiao1964 2017-06-19 08:20
浏览 167

ldap_search()操作错误

I've looked at a lot of other questions about this but can't seen to find the solution for my error.

The code I use is:

ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
$ldapconn = ldap_connect('[HOST]', 389);
ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0);
ldap_bind($ldapconn, $username, $password);

$authUser = $adldap->user()->authenticate($username, $password);
if ($authUser == true) {
    echo "jep";
    echo "<br />";

    $basedn     =   "DC=lab,DC=kuhlmann-its,DC=local";
    $classname  =   "TAI2";
    $filter     =   "(memberOf=OU=" . $classname . ",OU=Accounts,OU=BBS_Students,OU=BBS,OU=EDUNET,DC=lab,DC=kuhlmann-its,DC=local)";
    $attributes =   array("cn");
    $search     =   ldap_search($ldapconn, $basedn, $filter, $attributes);
    $info       =   ldap_get_entries($ldapconn, $search);   

This is my first time working with LDAP and Active Directory and I don't know how all the functions work. I want to know why my ldap_search() is not working.

Thanks in advance.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
    • ¥15 有赏,i卡绘世画不出
    • ¥15 如何用stata画出文献中常见的安慰剂检验图
    • ¥15 c语言链表结构体数据插入
    • ¥40 使用MATLAB解答线性代数问题
    • ¥15 COCOS的问题COCOS的问题
    • ¥15 FPGA-SRIO初始化失败
    • ¥15 MapReduce实现倒排索引失败
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员