00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef __ILDAP_H
00012 #define __ILDAP_H
00013
00014 #include "INet.h"
00015 #include "lber.h"
00016 #include "ldap.h"
00017
00018
00019 #define LDAP_PORT 389
00020
00021 #define LDAP_ENTRY_PERSON 0x0001
00022 #define LDAP_ENTRY_GROUP 0x0002
00023
00024 class ILdapEntry
00025 {
00026 public:
00027 char *Name;
00028 char *Email;
00029 int Type;
00030
00031 bool IsGroup() { return TestFlag(Type, LDAP_ENTRY_GROUP); }
00032
00033 ILdapEntry();
00034 virtual ~ILdapEntry();
00035 };
00036
00037 class ILdap
00038 {
00039 LDAP *Ldap;
00040 int Opt_ProtocolVer;
00041 int Opt_Deref;
00042 bool Opt_Restart;
00043
00044 public:
00045 ILdap();
00046 virtual ~ILdap();
00047
00048 void SetProtocol(int i);
00049 void SetDeref(int i);
00050 void SetRestart(bool i);
00051
00052 bool Open(int Version, char *RemoteServer, int Port = LDAP_PORT, char *User = 0, char *Pass = 0);
00053 bool Close();
00054
00055 ILdapEntry *RetreiveOne(char *Name, char *Base = 0, bool Recursive = true);
00056 bool RetreiveList(List<ILdapEntry> &Entries, char *Base = 0, bool Recursive = true);
00057 };
00058
00059 #endif