14 printf(
"Could not connect to ldap.cern.ch\n");
22 printf(
"Search failed\n");
29 result = server.
Search(namingcontexts, LDAP_SCOPE_ONELEVEL, 0, 0, 1);
38 cout <<
"The DN of the entry is " << dn << endl;
40 result = server.
Search(dn, LDAP_SCOPE_SUBTREE, 0, 0, 0);
43 printf(
"Search failed\n");
49 cout <<
"The result contains " << counter <<
" entries !!!" << endl;
56 cout <<
"The attribute " << attribute.
GetName() <<
" contains " 57 << counter2 <<
" values !!!" << endl;
58 const char *value = attribute.
GetValue();
59 cout <<
"The first value of the attribute is " << endl;
60 cout << value << endl;
virtual const char * GetName() const
Returns name of object.
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.
Bool_t IsConnected() const
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
const char * GetNamingContexts()
Performs an LDAPSearch with the attribute "namingContexts" to be returned with the result...
Int_t GetCount() const
Returns the number of entries in the search result.
void Print(Option_t *="") const
Print entry in LDIF format.
TLDAPAttribute * GetAttribute() const
Get next attribute of the entry.
R__EXTERN TSystem * gSystem
void Print(Option_t *option="") const
Prints all entries.
TLDAPEntry * GetNext()
Returns next entry from the search result.
const char * GetDn() const
const char * GetValue() const
Get next value of the attribute.