context.activeUser
*/
-@class NSString, NSArray, NSURL;
+@class NSString, NSArray, NSURL, NSUserDefaults;
@interface SOGoUser : SoUser
{
- NSString *cn;
- NSString *email;
+ NSString *cn;
+ NSString *email;
+ NSUserDefaults *userDefaults;
}
/* properties */
- (NSArray *)additionalEMailAddresses;
- (NSURL *)freeBusyURL;
+/* defaults */
+
+- (NSUserDefaults *)userDefaults;
+
@end
#endif /* __SOGoUser_H__ */
@implementation SOGoUser
- (void)dealloc {
+ [self->userDefaults release];
[self->cn release];
[self->email release];
[super dealloc];
return [[self userManager] getFreeBusyURLForUID:[self login]];
}
+/* defaults */
+
+- (NSUserDefaults *)userDefaults {
+ if (self->userDefaults == nil) {
+ self->userDefaults =
+ [[[self userManager] getUserDefaultsForUID:[self login]] retain];
+ }
+ return self->userDefaults;
+}
+
@end /* SOGoUser */
+2005-07-12 Helge Hess <helge.hess@opengroupware.org>
+
+ * added sql/profile-create.psql to create the user-profile database
+ table (not strictly related to OCSContentStore)
+
2005-07-05 Marcus Mueller <znek@mulle-kybernetik.com>
* iCalEntityObject+OCS.m: fixed stupid extraction bug (v0.9.29)
--- $Id$
--
--- (C) 2004 SKYRIX Software AG
+-- (C) 2004-2005 SKYRIX Software AG
--
CREATE TABLE %s_quick (
--- $Id$
--
--- (C) 2004 SKYRIX Software AG
+-- (C) 2004-2005 SKYRIX Software AG
--
-- TODO:
-- add a unique constraints on path
--- /dev/null
+--
+-- (C) 2005 SKYRIX Software AG
+--
+
+CREATE TABLE SOGo_user_profile (
+ uid VARCHAR(255) NOT NULL PRIMARY KEY,
+ allowinternet SMALLINT DEFAULT 0,
+ timezonename VARCHAR(255) DEFAULT 'MET'
+);
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#ifndef __AgenorUserDefaults_H_
+#define __AgenorUserDefaults_H_
+
+#import <Foundation/NSObject.h>
+
+/*
+ AgenorUserDefaults
+
+ An object with the same API like NSUserDefaults which retrieves profile
+ information for users in the database.
+*/
+
+@interface AgenorUserDefaults : NSObject
+{
+ NSString *uid;
+}
+
+@end
+
+#endif /* __AgenorUserDefaults_H_ */
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include "AgenorUserDefaults.h"
+#include "common.h"
+
+@implementation AgenorUserDefaults
+
+- (void)dealloc {
+ [self->uid release];
+ [super dealloc];
+}
+
+@end /* AgenorUserDefaults */
TODO: document
*/
-@class NSString, NSArray, NSURL;
+@class NSString, NSArray, NSURL, NSUserDefaults;
@class SOGoLRUCache;
@interface AgenorUserManager : NSObject
- (NSURL *)getFreeBusyURLForUID:(NSString *)_uid;
+- (NSUserDefaults *)getUserDefaultsForUID:(NSString *)_uid;
+
@end
#endif /* __AgenorUserManager_H_ */
return nil;
}
+/* defaults */
+
+- (NSUserDefaults *)getUserDefaultsForUID:(NSString *)_uid {
+ [self logWithFormat:@"TODO: implement!"];
+ return nil;
+}
+
/* debugging */
- (BOOL)isDebuggingEnabled {
+2005-07-12 Helge Hess <helge.hess@opengroupware.org>
+
+ * v0.9.43
+
+ * added agenor_defaults tool to test defaults functionality
+
+ * AgenorUserManager.[hm]: added -getUserDefaultsForUID: method to
+ retrieve the profile of a user (incomplete)
+
+ * added AgenorUserDefaults class (incomplete) as a wrapper for the
+ profile data of Agenor users
+
2005-07-08 Helge Hess <helge.hess@opengroupware.org>
* v0.9.42
-include ./Version
LIBRARY_NAME = libSOGo
-TOOL_NAME = agenor_email2uid agenor_shares4uid agenor_emails4uid
+
+TOOL_NAME = \
+ agenor_email2uid \
+ agenor_shares4uid \
+ agenor_emails4uid \
+ agenor_defaults
libSOGo_SOVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
AgenorUserManager.m \
NSObject+AptComparison.m \
WOContext+Agenor.m \
+ AgenorUserDefaults.m \
# tools
-agenor_email2uid_OBJC_FILES += \
- agenor_email2uid.m \
- AgenorUserManager.m \
- SOGoLRUCache.m \
-
-agenor_shares4uid_OBJC_FILES += \
- agenor_shares4uid.m \
+COMMON_TOOL_FILES = \
AgenorUserManager.m \
+ AgenorUserDefaults.m \
SOGoLRUCache.m \
-agenor_emails4uid_OBJC_FILES += \
- agenor_emails4uid.m \
- AgenorUserManager.m \
- SOGoLRUCache.m \
+agenor_email2uid_OBJC_FILES += agenor_email2uid.m $(COMMON_TOOL_FILES)
+agenor_shares4uid_OBJC_FILES += agenor_shares4uid.m $(COMMON_TOOL_FILES)
+agenor_emails4uid_OBJC_FILES += agenor_emails4uid.m $(COMMON_TOOL_FILES)
+agenor_defaults_OBJC_FILES += agenor_defaults.m $(COMMON_TOOL_FILES)
-include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make
-lXmlRpc -lDOM -lSaxObjC \
-lNGLdap
-agenor_email2uid_TOOL_LIBS += -lNGLdap
-agenor_shares4uid_TOOL_LIBS += -lNGLdap
-agenor_emails4uid_TOOL_LIBS += -lNGLdap
+ADDITIONAL_TOOL_LIBS += -lNGLdap
+
# version file
-SUBMINOR_VERSION:=42
+SUBMINOR_VERSION:=43
# v0.9.34 requires libGDLContentStore v4.5.26
# v0.9.26 requires libOGoContentStore v0.9.13
--- /dev/null
+/*
+ Copyright (C) 2005 SKYRIX Software AG
+
+ This file is part of OpenGroupware.org.
+
+ OGo is free software; you can redistribute it and/or modify it under
+ the terms of the GNU Lesser General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with OGo; see the file COPYING. If not, write to the
+ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.
+*/
+
+#include "AgenorUserManager.h"
+#include "common.h"
+
+static void usage(NSArray *args) {
+ fprintf(stderr, "usage: %s <uid> read|write <key> [<value>]\n",
+ [[args objectAtIndex:0] cString]);
+}
+
+static void doRead(NSUserDefaults *defaults, NSString *key) {
+ NSLog(@"TODO READ: %@", key);
+}
+
+static void doWrite(NSUserDefaults *defaults, NSString *key, NSString *value) {
+ NSLog(@"TODO WRITE: %@", key, value);
+}
+
+static void doIt(NSArray *args) {
+ AgenorUserManager *userManager;
+ NSUserDefaults *defaults;
+ NSString *uid, *op, *key, *value;
+
+ /* extract arguments */
+
+ if ([args count] < 4) {
+ usage(args);
+ return;
+ }
+
+ uid = [args objectAtIndex:1];
+ op = [args objectAtIndex:2];
+ key = [args objectAtIndex:3];
+ value = nil;
+
+ if ([op isEqualToString:@"write"]) {
+ if ([args count] < 5) {
+ usage(args);
+ return;
+ }
+ value = [args objectAtIndex:4];
+ }
+
+ /* run */
+
+ userManager = [AgenorUserManager sharedUserManager];
+ defaults = [userManager getUserDefaultsForUID:uid];
+
+ if (![defaults isNotNull]) {
+ fprintf(stderr, "Error: found no userdefaults for UID: '%s'\n",
+ [uid cString]);
+ exit(1);
+ }
+
+ if ([op isEqualToString:@"read"])
+ doRead(defaults, key);
+ else if ([op isEqualToString:@"write"])
+ doWrite(defaults, key, value);
+ else
+ usage(args);
+}
+
+int main(int argc, char **argv, char **env) {
+ NSAutoreleasePool *pool;
+
+ pool = [[NSAutoreleasePool alloc] init];
+#if LIB_FOUNDATION_LIBRARY
+ [NSProcessInfo initializeWithArguments:argv count:argc environment:env];
+#endif
+
+ doIt([[NSProcessInfo processInfo] argumentsWithoutDefaults]);
+
+ [pool release];
+ return 0;
+}