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;
}
- Author
Definition in file LDAPExample.C.