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

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

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

          <bdo id='YLlBI'></bdo><ul id='YLlBI'></ul>
      1. <tfoot id='YLlBI'></tfoot>

        从 PHP 中的 openLDAP 获取所有可能的属性和所有 objectClasses

        Get all possible attributes and all objectClasses from openLDAP in PHP(从 PHP 中的 openLDAP 获取所有可能的属性和所有 objectClasses)
        <i id='GEqnm'><tr id='GEqnm'><dt id='GEqnm'><q id='GEqnm'><span id='GEqnm'><b id='GEqnm'><form id='GEqnm'><ins id='GEqnm'></ins><ul id='GEqnm'></ul><sub id='GEqnm'></sub></form><legend id='GEqnm'></legend><bdo id='GEqnm'><pre id='GEqnm'><center id='GEqnm'></center></pre></bdo></b><th id='GEqnm'></th></span></q></dt></tr></i><div id='GEqnm'><tfoot id='GEqnm'></tfoot><dl id='GEqnm'><fieldset id='GEqnm'></fieldset></dl></div>

        <tfoot id='GEqnm'></tfoot>

            <tbody id='GEqnm'></tbody>
        1. <legend id='GEqnm'><style id='GEqnm'><dir id='GEqnm'><q id='GEqnm'></q></dir></style></legend>

            • <small id='GEqnm'></small><noframes id='GEqnm'>

                • <bdo id='GEqnm'></bdo><ul id='GEqnm'></ul>
                  本文介绍了从 PHP 中的 openLDAP 获取所有可能的属性和所有 objectClasses的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我必须用 PHP 编写 LDAP 编辑器.LDAP 用于存储网络设备(交换机、AP、..).所以,这不是正常的功能,我发现了很多问题.最大的问题是:

                  I have to write LDAP editor in PHP. LDAP is used for store network devices (switch,AP,..). So, it is not normal functionality and I found lot of problems. The biggest problem is:

                  是否可以从数据库中读取所有对象类以及给定对象类的所有属性?

                  Is possible to read all objectClasses from database and all attributes for given objectClass?

                  感谢所有回复!!阿贾克斯

                  Thanks for all replies!! Ajax

                  推荐答案

                  为什么不呢?

                  每个服务器都会有一个子模式条目,其中包含所有对象类和属性类型.(包括广告)

                  There will be a subschema entry per server which comprises all the objectclasses and attributetypes. (including AD)

                  但是subschema entry dn在每个实现中可能不同,这个可以从rootDSE属性subschemasubentry"中查到

                  But the subschema entry dn may be different in each implementation, this can be looked up from rootDSE attribute "subschemasubentry"

                  -AD example-
                  ldapsearch -s base -b "" -D cn=Administrator,cn=users,dc=domain,dc=com -w 'password' -x -h 192.168.3.10 objectClass=* subschemasubentry
                  
                  **OUTPUT:**
                  dn:
                  subschemaSubentry: CN=Aggregate,CN=Schema,CN=Configuration,DC=domain,DC=com
                  
                  
                  -OpenLdap example-
                  ldapsearch -s base -b "" -D cn=Administrator,dc=capua,dc=com -w password -x -h 192.168.3.11 subschemaSubentry 
                  
                  **OUTPUT:**
                  #
                  dn:
                  objectClass: top
                  objectClass: OpenLDAProotDSE
                  subschemaSubentry: cn=Subschema
                  

                  另外,请注意搜索范围.应该是BASE_LEVEL,否则不会返回任何结果.

                  Also, note the search scope. It should be BASE_LEVEL, otherwise it wont return any result.

                  在此之后搜索对象类和属性类型的子模式.

                  After this search the subschema for objectclasses and attributetypes.

                  ldapsearch -s base -b "cn=subschema" -D cn=Administrator,dc=capua,dc=com -w password -x -h 192.168.3.11  objectclass=subschema objectclasses attributetypes
                  

                  这会将所有对象类和属性类型作为字符串返回.您没有查询给定对象类的属性列表的选项.您只能获取所有存储的对象类和属性的 ldif 输出.如果可行,您可能可以编写解析器或创建一些 ldif 对象.但是如果是 AD 的话,直接查询 cn=Schema,cn=configuration 可能就没有什么灵活性了.

                  This will return all the objectclasses and attributetypes as string. You dont have an option of querying list of attribute of a given objectclass. You can ONLY get the ldif output of all stored objetclass and attribute. Probably you can write a parser or create some ldif object if that works. But if its AD you might have little flexibility by directly querying cn=Schema,cn=configuration.

                  看看 php 代码.假设 $ld 已连接.某些目录服务器允许对子模式进行匿名读取,在这种情况下您不需要绑定.

                  Have a look at the php code. Assuming $ld is connected. Some directory server allows anonymous read on the subschema, in which case you dont need to bind.

                    //Get the subschema dn from rootDSE
                    $search = ldap_read($ld, "", "objectclass=*", array('*', 'subschemasubentry'));
                    $entries = ldap_get_entries($ld, $search);
                    $schemadn = $entries[0]["subschemasubentry"][0];
                  
                    print "Searching ". $schemadn . "<br/>";
                  
                    // Read all objectclass, attributetype from subschema
                    $schsearch = ldap_read($ld, $schemadn, "objectClass=subSchema", array('objectclasses', 'attributetypes'));
                    $schentries = ldap_get_entries($ld, $schsearch);
                  
                    $count = $schentries[0]["attributetypes"]["count"];
                  
                    print "Printing all attribute types <br/>";
                    for ($i=0; $i<$count; $i++)
                       print $schentries[0]["attributetypes"][$i] . "<br/>";
                  
                  
                    $count = $schentries[0]["objectclasses"]["count"];
                  
                    print "Printing all objectclasses <br/>";
                    for ($i=0; $i<$count; $i++)
                       print $schentries[0]["objectclasses"][$i] . "<br/>";
                  

                  这篇关于从 PHP 中的 openLDAP 获取所有可能的属性和所有 objectClasses的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  smtp gmail server php mailer not working(smtp gmail服务器php邮件程序不工作)
                  Email goes in spam when I send it via others SMTP server(当我通过其他 SMTP 服务器发送电子邮件时,电子邮件进入垃圾邮件)

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

                      <tbody id='vq64x'></tbody>
                    <tfoot id='vq64x'></tfoot>

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