[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: LDAP C API
В Чтв, 03/06/2010 в 18:10 -0700, Quanah Gibson-Mount пишет:
> --On Thursday, June 03, 2010 6:56 PM +0300 Покотиленко
> Костик <casper@meteor.dp.ua> wrote:
>
> > Did this message hit the list?
> >
> > Hi there,
> >
> > I'm writing GTK application for managing LDAP directory, a kind of GTK
> > variant of phpldapadmin.
> >
> > As for now I'm able to browse directory, objects' probepries and their
> > values.
> >
> > What is not clear is how to figure out the RDN and Required property,
> > and Structural value.
> >
> > How it is done?
>
> What do you mean by required property?
The property which is required for this object. I thought there could be
some calls to figure out whether the attribute required or not (also if
it RDN or structural or just plain attribute). I know It's possible to
analize the schema to figure that out, but maybe there is a simple way.
> The RDN is the first value of the
> full DN.
So if the attribute=value equals to first part of full DN then it is
RDN, right?
> You can look at the structuralObjectClass attr to find what it is
> structurally.
To be more specific, there is a code to process ldap search result:
-------------------------
for (entry = ldap_first_entry(ld, msg); entry != NULL; entry = ldap_next_entry(ld, entry)) {
// process entry here ...
for( attr = ldap_first_attribute(ld, entry, &ber); attr != NULL; attr = ldap_next_attribute(ld, entry, ber)) {
// process attributes here ...
if ((vals = ldap_get_values(ld, entry, attr)) != NULL) {
for(i = 0; vals[i]; i++) {
// processing values here ...
}
}
}
}
-------------------------
Say I want to fill GUI table for each entry with such Headers: Attribute, Values, Attribute Type (RDN|Required|Structural)
So, I need to have a way to know whether each attibute is RDN or Required or Structural, etc
--
Покотиленко Костик <casper@meteor.dp.ua>