2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __NGLdapConnection_H__
24 #define __NGLdapConnection_H__
26 #import <Foundation/NSObject.h>
27 #import <Foundation/NSDate.h>
29 @class NSString, NSArray, NSEnumerator;
33 @interface NGLdapConnection : NSObject
39 NSTimeInterval cacheTimeout;
40 long cacheMaxMemory; /* in bytes */
48 - (id)initWithHostName:(NSString *)_hostName port:(int)_port; // designated init
49 - (id)initWithHostName:(NSString *)_hostName;
53 - (NSString *)hostName;
61 - (BOOL)bindWithMethod:(NSString *)_method
62 binddn:(NSString *)_login credentials:(NSString *)_cred;
66 - (NSEnumerator *)flatSearchAtBaseDN:(NSString *)_base
67 qualifier:(EOQualifier *)_q
68 attributes:(NSArray *)_attributes;
69 - (NSEnumerator *)deepSearchAtBaseDN:(NSString *)_base
70 qualifier:(EOQualifier *)_q
71 attributes:(NSArray *)_attributes;
72 - (NSEnumerator *)baseSearchAtBaseDN:(NSString *)_base
73 qualifier:(EOQualifier *)_q
74 attributes:(NSArray *)_attributes;
76 - (NGLdapEntry *)entryAtDN:(NSString *)_dn attributes:(NSArray *)_attrs;
80 - (void)setCacheTimeout:(NSTimeInterval)_to;
81 - (NSTimeInterval)cacheTimeout;
83 - (void)setCacheMaxMemoryUsage:(long)_maxMem;
84 - (long)cacheMaxMemoryUsage;
86 - (void)setUseCache:(BOOL)_flag;
92 - (void)cacheForgetEntryWithDN:(NSString *)_dn;
96 - (BOOL)addEntry:(NGLdapEntry *)_entry;
97 - (BOOL)removeEntryWithDN:(NSString *)_dn;
98 - (BOOL)modifyEntryWithDN:(NSString *)_dn changes:(NSArray *)_mods;
102 - (NGLdapEntry *)schemaEntry;
103 - (NGLdapEntry *)rootDSE;
104 - (NGLdapEntry *)configEntry;
105 - (NSArray *)namingContexts;
109 @interface NGLdapConnection(PlainPasswordCheck)
111 /* specialized password check routine */
113 - (NSString *)dnForLogin:(NSString *)_login baseDN:(NSString *)_baseDN;
115 + (BOOL)checkPassword:(NSString *)_pwd ofLogin:(NSString *)_login
116 atBaseDN:(NSString *)_baseDN
117 onHost:(NSString *)_hostName port:(int)_port;
121 #endif /* __NGLdapConnection_H__ */