【发布时间】:2011-04-06 21:53:13
【问题描述】:
我正在尝试使用 PHP 搜索 Windows 2008 服务器上的 LDAP 用户条目——具体来说是 PEAR 的 Net_LDAP2 包。我已经成功连接到服务器并绑定了一个用户;但是,搜索用户会导致 LDAP_OPERATIONS_ERROR。我能找到的最多的解决方案是很难确定一个解决方案。
是否有人熟悉在 Windows 2008 上通过 PHP 连接到 LDAP 并且知道访问目录所需的调整?
// LDAP Abstraction Layer with static instance of NET_LDAP2.
$LDAPConnection = new LDAPAbstractionLayer('username', 'password');
// Simple filter
$filter = Net_LDAP2_Filter::create('sn', 'begins', 'S');
$searchbase = 'DC=example,DC=domain';
$options = array('scope' => 'sub', 'attributes' => array('sn'));
$search = $LDAPConnection->connection->search($searchbase, $filter, $options);
感谢您的帮助。
【问题讨论】: