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
why not?
There will be a subschema entry per server which comprises all the objectclasses and attributetypes. (including AD)
But the subschema entry dn may be different in each implementation, this can be looked up from rootDSE attribute “subschemasubentry”
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.
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.
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.