void LDAPExample()
{
printf("Could not connect to ldap.cern.ch\n");
delete server;
return;
}
if (result == 0) {
printf("Search failed\n");
return;
}
delete result;
result = server.
Search(namingcontexts, LDAP_SCOPE_ONELEVEL, 0, 0, 1);
delete result;
delete entry;
cout << "The DN of the entry is " << dn << endl;
result = server.
Search(dn, LDAP_SCOPE_SUBTREE, 0, 0, 0);
if (result == 0) {
printf("Search failed\n");
return;
}
cout << "The result contains " << counter << " entries !!!" << endl;
cout <<
"The attribute " << attribute.
GetName() <<
" contains "
<< counter2 << " values !!!" << endl;
const char *value = attribute.
GetValue();
cout << "The first value of the attribute is " << endl;
cout << value << endl;
delete result;
delete entry;
}
R__EXTERN TSystem * gSystem
const char * GetValue() const
Get next value of the attribute.
TLDAPAttribute * GetAttribute() const
Get next attribute of the entry.
void Print(Option_t *="") const
Print entry in LDIF format.
const char * GetDn() const
TLDAPEntry * GetNext()
Returns next entry from the search result.
Int_t GetCount() const
Returns the number of entries in the search result.
void Print(Option_t *option="") const
Prints all entries.
Bool_t IsConnected() const
TLDAPResult * Search(const char *base="", Int_t scope=LDAP_SCOPE_BASE, const char *filter=0, TList *attrs=0, Bool_t attrsonly=0)
Performs searching at the LDAP directory.
const char * GetNamingContexts()
Performs an LDAPSearch with the attribute "namingContexts" to be returned with the result.
virtual const char * GetName() const
Returns name of object.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.