00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ROOT_TLDAPServer
00010 #define ROOT_TLDAPServer
00011
00012 #ifndef ROOT_TObject
00013 #include "TObject.h"
00014 #endif
00015 #ifndef ROOT_TString
00016 #include "TString.h"
00017 #endif
00018 #ifndef ROOT_CintLDAP
00019 #include "CintLDAP.h"
00020 #endif
00021
00022 class TList;
00023 class TLDAPResult;
00024 class TLDAPEntry;
00025
00026
00027 class TLDAPServer : public TObject {
00028
00029 private:
00030 LDAP *fLd;
00031 TString fBinddn;
00032 TString fPassword;
00033 Bool_t fIsConnected;
00034
00035 Int_t Bind();
00036 void Unbind();
00037
00038 static void DeleteMods(LDAPMod **mods);
00039
00040 protected:
00041 TLDAPServer(const TLDAPServer&);
00042 TLDAPServer& operator=(const TLDAPServer&);
00043
00044 public:
00045 TLDAPServer(const char *host, Int_t port = LDAP_PORT,
00046 const char *binddn = 0, const char *password = 0,
00047 Int_t version = LDAP_VERSION2);
00048
00049 virtual ~TLDAPServer();
00050
00051 Bool_t IsConnected() const { return fIsConnected; };
00052 TLDAPResult *Search(const char *base = "",
00053 Int_t scope = LDAP_SCOPE_BASE,
00054 const char *filter = 0,
00055 TList *attrs = 0,
00056 Bool_t attrsonly = 0);
00057 const char *GetNamingContexts();
00058 const char *GetSubschemaSubentry();
00059 TLDAPResult *GetObjectClasses();
00060 TLDAPResult *GetAttributeTypes();
00061
00062 Int_t AddEntry(TLDAPEntry &entry);
00063 Int_t ModifyEntry(TLDAPEntry &entry, Int_t mode = LDAP_MOD_REPLACE);
00064 Int_t DeleteEntry(const char *dn);
00065 Int_t RenameEntry(const char *dn, const char *newrdn,
00066 Bool_t removeattr = kFALSE);
00067
00068 ClassDef(TLDAPServer, 0)
00069 };
00070
00071 #endif