<tfoot id='1RWoE'></tfoot>

      <bdo id='1RWoE'></bdo><ul id='1RWoE'></ul>

    <small id='1RWoE'></small><noframes id='1RWoE'>

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

    1. ldap_add():添加:对象类违规错误

      ldap_add(): Add: Object class violation error(ldap_add():添加:对象类违规错误)

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

      • <bdo id='lfAHD'></bdo><ul id='lfAHD'></ul>

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

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

                本文介绍了ldap_add():添加:对象类违规错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                当我尝试通过 PHP 向 OpenDS 添加属性时,出现以下错误:

                When I try to add attribute to the OpenDS via PHP I get the following error:

                ldap_add(): 添加:对象类违规

                ldap_add(): Add: Object class violation

                请帮忙.

                这是我的代码

                <?php
                $ldapconfig['host'] = 'PC100';
                $ldapconfig['port'] = 1389;
                $ldapconfig['basedn'] = 'dc=company,dc=com';
                
                $ds=ldap_connect($ldapconfig['host'], $ldapconfig['port']);
                
                $password=1;
                $username="cn=Directory Manager";
                
                if ($bind=ldap_bind($ds, $username, $password)) {
                  echo("Login correct");
                  ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); // IMPORTANT
                  $dn = "cn=roshan1,dc=example,dc=com"; 
                  //$newuser["objectclass"] = "inetOrgPerson"; 
                  //$newuser["cn"] = "new1"; 
                  //$newuser["sn"] = "user"; 
                
                  $ldaprecord['cn'] = "roshan1";
                  $ldaprecord['givenName'] = "mkljl";
                  $ldaprecord['sn'] = "roshan";
                  $ldaprecord['objectclass'] = "inetOrgPerson";    
                  $ldaprecord['mail'] = "lkl@fh.com";
                  $ldaprecord['mmmm'] = "77878";
                
                  // add data to directory
                  $r = ldap_add($ds, $dn, $ldaprecord);
                
                } else {
                
                  echo("Unable to bind to server.</br>");
                
                }
                ?>
                

                如果我从代码中删除 $ldaprecord['mmmm'] = "77878"; 它可以正常工作.如何添加这样的新属性?

                If I remove $ldaprecord['mmmm'] = "77878"; from the code it works fine. How can I add a new attribute like this?

                推荐答案

                嗯,看起来你只是想将 objectclass 设置为 inetOrgPerson,但你必须还设置 inetorgPerson 从中扩展的其他上层类-可能是 topperson ...

                Hmm, it looks like You are trying only to set objectclass to inetOrgPerson, but You have to set also other upper classes from which inetorgPerson is extending - that would be top and person maybe...

                所以:

                $ldaprecord['cn'] = "roshan1";
                $ldaprecord['givenName'] = "mkljl";
                $ldaprecord['sn'] = "roshan";
                $ldaprecord['objectclass'][0] = "top";
                $ldaprecord['objectclass'][1] = "person";
                $ldaprecord['objectclass'][2] = "inetOrgPerson";
                $ldaprecord['mail'] = "lkl@fh.com";
                $ldaprecord['mmmm'] = "77878";
                

                这篇关于ldap_add():添加:对象类违规错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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='3bQUV'></small><noframes id='3bQUV'>

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