#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    15
    Rep Power
    0

    Modifiying schema


    If I want to modify the object person and add for it the field expire date.

    How should the ldif file look like?


    Code:
    dn: cn=schema
    changetype: modify
    add: attributeTypes
    attributeTypes:
    NAME ExpireDate
    DESC 'the time when the password expire
    SYNTAX 
    SINGLE-VALUE
    USAGE expiringdate
    I mean how do I tell open ldap that it should be for the object person?

    Thank in advance.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    10
    Rep Power
    0
    I am not sure if you can modify an existing objectClass at all without editing the .schema files by hand (anyone more knowledgeable: feel free to post the answer )


    Do you already have objects of the person type in your directory?

    If not I think it's more feasible to simply add your attributeType and a new objectClass that has person as SUP and your ExpireDate attributeType included.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2011
    Posts
    15
    Rep Power
    0
    Originally Posted by Greht
    I am not sure if you can modify an existing objectClass at all without editing the .schema files by hand (anyone more knowledgeable: feel free to post the answer )


    Do you already have objects of the person type in your directory?

    If not I think it's more feasible to simply add your attributeType and a new objectClass that has person as SUP and your ExpireDate attributeType included.
    first a lot of thanks for your answer.

    well, there is object-class person in the schema.
    However it doesn't include all the attribute that I need.

    I need object-class with the following attributes:
    unsername
    password
    Expiredate
    status.

    Now I found out a page that say how to create a new object:
    http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Frzahy%2Frzahyeditobj.htm
    To edit an object class using the command line, issue the following command:

    ldapmodify -D <adminDN> -w <adminPW> -i <filename>

    where <filename>contains:

    Code:
    dn: cn=schema
    changetype: modify
    replace: objectclasses
    objectclasses: ( <myobjectClass-oid> NAME '<myObjectClass>' DESC '<An object class
                     I defined for my LDAP application>' SUP '<newsuperiorclassobject>'
                     <newobjectclasstype> MAY (attribute1> $ <attribute2>
                      $ <newattribute3>) )
    However I an no so about a few things.
    What should I write after the sup ?
    And do I need to include the <> or they are there as symbol to wrap?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2011
    Posts
    10
    Rep Power
    0
    Originally Posted by programAngel
    What should I write after the sup ?
    the NAME of the class you want to have as superior. In this case "person" (without ")

    Originally Posted by programAngel
    And do I need to include the <> or they are there as symbol to wrap?
    They are just symbols. You simply write the NAMEs of the attribute types you want to include without any special characters (but dont forget the '$' seperators).

IMN logo majestic logo threadwatch logo seochat tools logo