• <tfoot id='Y4lUK'></tfoot>

        • <bdo id='Y4lUK'></bdo><ul id='Y4lUK'></ul>
        <i id='Y4lUK'><tr id='Y4lUK'><dt id='Y4lUK'><q id='Y4lUK'><span id='Y4lUK'><b id='Y4lUK'><form id='Y4lUK'><ins id='Y4lUK'></ins><ul id='Y4lUK'></ul><sub id='Y4lUK'></sub></form><legend id='Y4lUK'></legend><bdo id='Y4lUK'><pre id='Y4lUK'><center id='Y4lUK'></center></pre></bdo></b><th id='Y4lUK'></th></span></q></dt></tr></i><div id='Y4lUK'><tfoot id='Y4lUK'></tfoot><dl id='Y4lUK'><fieldset id='Y4lUK'></fieldset></dl></div>

        <small id='Y4lUK'></small><noframes id='Y4lUK'>

        <legend id='Y4lUK'><style id='Y4lUK'><dir id='Y4lUK'><q id='Y4lUK'></q></dir></style></legend>

        用于区分名称的 ldap 过滤器

        时间:2024-08-23
          <tbody id='dT4Hj'></tbody>

                  <bdo id='dT4Hj'></bdo><ul id='dT4Hj'></ul>
                  <tfoot id='dT4Hj'></tfoot>
                • <small id='dT4Hj'></small><noframes id='dT4Hj'>

                • <i id='dT4Hj'><tr id='dT4Hj'><dt id='dT4Hj'><q id='dT4Hj'><span id='dT4Hj'><b id='dT4Hj'><form id='dT4Hj'><ins id='dT4Hj'></ins><ul id='dT4Hj'></ul><sub id='dT4Hj'></sub></form><legend id='dT4Hj'></legend><bdo id='dT4Hj'><pre id='dT4Hj'><center id='dT4Hj'></center></pre></bdo></b><th id='dT4Hj'></th></span></q></dt></tr></i><div id='dT4Hj'><tfoot id='dT4Hj'></tfoot><dl id='dT4Hj'><fieldset id='dT4Hj'></fieldset></dl></div>
                • <legend id='dT4Hj'><style id='dT4Hj'><dir id='dT4Hj'><q id='dT4Hj'></q></dir></style></legend>
                  本文介绍了用于区分名称的 ldap 过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用以下代码成功地在我们的 Active Directory 中查询用户:

                  I am successfully querying our Active Directory for a user with the following code:

                  $filter = (&(objectCategory=person)(samaccountname=someusername));
                  $fields = array("samaccountname","mail","manager","department","displayname","objectGUID");
                  
                  $user = ldap_search($ldapconnection, $baseDn, $filter, $fields);
                  

                  生成的数组为 manager 属性提供此值:

                  The resulting array gives this value for the manager attribute:

                  CN=McBossy, Boss,OU=Users,OU=CentralOffice,DC=ds,DC=example,DC=com
                  

                  对我来说,这看起来像是一个杰出的名字.但是当我尝试查询经理的记录时,

                  This looks like a distinguishedName to me. But when I try to query for the manager's record,

                  $filter = (&(objectCategory=person)(dn='CN=McBossy, Boss,OU=Users,OU=CentralOffice,DC=ds,DC=example,DC=com'));
                  
                  $manager = ldap_search($ldapconnection, $baseDn, $filter, $fields);
                  

                  查询失败,PHP 警告:ldap_search(): Search: Bad search filter

                  我尝试了多种可能性,包括不同的引用、更多的括号、使用 distinguishedName 而不是 dn 等.

                  I've tried a number of possibilities including different quotation, more parentheses, using distinguishedName rather than dn, etc.

                  我做错了什么,获取经理记录的正确方法是什么?

                  What am I doing wrong and what is the right way to get the manager's record?

                  推荐答案

                  dn 不是属性.过滤器中只能使用属性类型、OID 和名称.

                  dn is not an attribute. Only attribute types, OIDs, and names can be used in filters.

                  当您获得 manager 属性时,要获得作为经理的 DN 的属性,请使用 manager 属性的值作为搜索中的基本对象要求.将搜索范围设置为 BASE,将过滤器设置为 (&)(objectClass=*) 并请求所需的属性.然后将搜索请求传输到服务器并解释响应.

                  When you get the manager attribute, to get the attributes for the DN that is the manager, use the value of the manager attribute as the base object in a search request. Set the scope of the search to BASE, the filter to either (&) or (objectClass=*) and request the attributes required. Then transmit the search request to the server and interpret the response.

                  这篇关于用于区分名称的 ldap 过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Symfony 5.1:使用实体用户提供者的 LDAP 身份验证 下一篇:在使用 IE/Firefox 时使用 PHP、活动目录对 ldap 进行身份验证

                  相关文章

                  <tfoot id='XrvZ1'></tfoot>
                  1. <small id='XrvZ1'></small><noframes id='XrvZ1'>

                    <i id='XrvZ1'><tr id='XrvZ1'><dt id='XrvZ1'><q id='XrvZ1'><span id='XrvZ1'><b id='XrvZ1'><form id='XrvZ1'><ins id='XrvZ1'></ins><ul id='XrvZ1'></ul><sub id='XrvZ1'></sub></form><legend id='XrvZ1'></legend><bdo id='XrvZ1'><pre id='XrvZ1'><center id='XrvZ1'></center></pre></bdo></b><th id='XrvZ1'></th></span></q></dt></tr></i><div id='XrvZ1'><tfoot id='XrvZ1'></tfoot><dl id='XrvZ1'><fieldset id='XrvZ1'></fieldset></dl></div>
                  2. <legend id='XrvZ1'><style id='XrvZ1'><dir id='XrvZ1'><q id='XrvZ1'></q></dir></style></legend>

                      <bdo id='XrvZ1'></bdo><ul id='XrvZ1'></ul>