Menu

can't store country and urls

2018-02-06
2018-02-13
  • Diego Coppola Libetta

    Hello, I'm using the last version with openldap server.

    Can you please explain me what I have to modify in the config file to store country and urls?
    I get this error: Error whilst setting attribute 'c': Object class violation

    Thanks

     

    Last edit: Diego Coppola Libetta 2018-02-06
  • James Turner

    James Turner - 2018-02-13

    The display layout in the sample config file includes some attributes - such as the country and
    URLs - that are specific to Active Directory and are not defined in OpenLDAP's schema by default.

    The "Object class violation" error occurs because the object class which is used for
    storing address book records ("inetOrgPerson") doesn't have a country attribute.

    As a starting point, I suggest replacing the display layout with this, which should work
    properly in OpenLDAP:

    $ldap_server->add_display_layout("inetOrgPerson",array(
            array("section_name"=>gettext("Personal"),
                    "attributes"=>array(
                            array("givenName",                      gettext("Given Name"),          "contact24.png","allow_view"=>false),
                            array("sn",                             gettext("Surname"),             "contact24.png","allow_view"=>false),
                            array("cn",                             gettext("Full Name"),           "contact24.png","allow_view"=>false),
                            array("displayName",                    gettext("Preferred Name"),      "contact24.png"),
                            array("mail",                           gettext("E-mail"),              "mail.png"),
                            array("homePhone",                      gettext("Home Phone"),          "landline-phone.png"),
            //              array("pager",                          gettext("Pager"),               "generic24.png"),
                            array("mobile",                         gettext("Mobile Phone"),        "cell-phone.png"),
                            array("street:l:st:postalCode",         gettext("Postal Address"),      "address.png"),
            //              array("jpegPhoto",                      gettext("Photo"),               "photo24.png")
                            )
                    ),
            array("section_name"=>gettext("Business/Work"),"width"=>"50%",
                    "attributes"=>array(
                            array("o",                              gettext("Company"),             "company.png"),
                            array("labeledURI",                     gettext("Web Page"),            "internet.png"),
                            array("telephoneNumber",                gettext("Office Phone"),        "landline-phone.png"),
                            array("facsimileTelephoneNumber",       gettext("Office Fax"),          "fax.png"),
                            array("title",                          gettext("Job Title"),           "org-role.png"),
                            array("ou",                             gettext("Department"),          "org.png"),
                            array("physicalDeliveryOfficeName",     gettext("Office"),              "office.png")
                            )
                    ),
            array("section_name"=>gettext("Additional Notes"),"new_row"=>true,"colspan"=>2,
                    "attributes"=>array(
                            array("description")
                            )
                    )
            ));
    

    Add the following line to the config file if you need to store more than one web page:

    $ldap_server->modify_attribute_schema("labeledURI","data_type","text_list");
    

    Unfortunately there aren't attributes for showing "Personal" and "Business/Work"
    web pages separately.

    As I mentioned above, inetOrgPerson records don't have a "country" attribute as
    standard. One way of working around this limitation is to store the country in a spare
    attribute that isn't being used. For example, to store it in "preferredLanguage":

    Add the following line to the new display layout:

    array("preferredLanguage",              "Country",              "country.png"),
    

    (I suggest adding it immediately after "Postal Address")

    Add the following line to the config file to make this attribute appear as a
    drop-down list of countries:

    $ldap_server->modify_attribute_schema("preferredLanguage","data_type","country_code");
    

    Hope this helps.

    Ideally the application shouldn't give you this problem - will look to make changes to prevent it, to be tracked via ticket #48.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.