See ChangeLog

Monotone-Parent: 8d42e44b72c2c9e6431e77f6b5c590736449f7d7
Monotone-Revision: bafccbe12139895411068d388269aca400af46ec

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2009-04-01T13:49:24
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2009-04-01 13:49:24 +00:00
parent 4d8563ac99
commit 8f2318fe52
56 changed files with 164 additions and 1302 deletions
-13
View File
@@ -9,12 +9,6 @@ FRAMEWORK_NAME = SOGo
SOGo_INSTALL_DIR = $(SOGO_LIBDIR)
TOOL_NAME = \
# sogo_email2uid \
# sogo_shares4uid \
# sogo_emails4uid \
# sogo_defaults
SOGo_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
# SOGoCustomGroupFolder.h \
@@ -125,13 +119,6 @@ SOGoNSUserDefaults_OBJC_FILES = \
endif
# tools
sogo_email2uid_OBJC_FILES += sogo_email2uid.m
sogo_shares4uid_OBJC_FILES += sogo_shares4uid.m
sogo_emails4uid_OBJC_FILES += sogo_emails4uid.m
sogo_defaults_OBJC_FILES += sogo_defaults.m
ADDITIONAL_TOOL_LIBS += -Lobj -lSOGo$(LIBRARY_NAME_SUFFIX)
ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
+1 -2
View File
@@ -19,7 +19,6 @@
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSDistributedNotificationCenter.h>
@@ -430,7 +429,7 @@ static NSLock *lock = nil;
[d setObject: [newUser objectForKey: @"c_uid"]
forKey: @"uid"];
[[NSDistributedNotificationCenter defaultCenter]
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"SOGoUserAttributesHaveLoaded"
object: nil
userInfo: d
+1 -1
View File
@@ -374,7 +374,7 @@ static NSMutableCharacterSet *urlStartChars = nil;
match];
sq = [EOQualifier qualifierWithQualifierFormat: format];
return [sq evaluateWithObject: self];
return [(id<EOQualifierEvaluation>)sq evaluateWithObject: self];
}
#if LIB_FOUNDATION_LIBRARY
+1 -1
View File
@@ -88,7 +88,7 @@
- (NSString *) displayName
{
return ((displayName) ? displayName : nameInContainer);
return ((id)displayName ? (id)displayName : (id)nameInContainer);
}
- (void) setIsSubscription: (BOOL) newIsSubscription
+4 -2
View File
@@ -47,6 +47,8 @@
#import "SOGoUserDefaults.h"
#import "SOGoUserFolder.h"
#import "../../Main/SOGo.h"
#import "SOGoUser.h"
static NSTimeZone *serverTimeZone = nil;
@@ -490,7 +492,7 @@ _timeValue (NSString *key)
[[SOGoCache sharedCache] setDefaults: defaults
forLogin: login key: @"defaults"];
[[NSDistributedNotificationCenter defaultCenter]
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"SOGoUserDefaultsHaveLoaded"
object: nil
userInfo: d
@@ -535,7 +537,7 @@ _timeValue (NSString *key)
[[SOGoCache sharedCache] setDefaults: settings forLogin: login key: @"settings"];
[[NSDistributedNotificationCenter defaultCenter]
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"SOGoUserSettingsHaveLoaded"
object: nil
userInfo: d
+2
View File
@@ -83,6 +83,8 @@
- (NSString *) jsonRepresentation;
- (BOOL) fetchProfile;
/* saving changes */
- (BOOL) synchronize;
+1 -1
View File
@@ -304,7 +304,7 @@ static NSString *uidColumnName = @"c_uid";
forLogin: uid
key: ([fieldName isEqualToString: @"c_defaults"] ? @"defaults" : @"settings")];
[[NSDistributedNotificationCenter defaultCenter]
[(NSDistributedNotificationCenter *)[NSDistributedNotificationCenter defaultCenter]
postNotificationName: ([fieldName isEqualToString: @"c_defaults"]
? @"SOGoUserDefaultsHaveChanged"
: @"SOGoUserSettingsHaveChanged")
+2 -2
View File
@@ -125,11 +125,11 @@ static NSString *LDAPContactInfoAttribute = nil;
filter = [NSMutableDictionary dictionaryWithCapacity: 2];
children = [parentNode getElementsByTagName: @"prop-match"];
max = [children count];
max = [(NSArray *)children count];
for (count = 0; count < max; count++)
{
node = [children objectAtIndex: count];
componentName = [[node attribute: @"name"] lowercaseString];
componentName = [[(id<DOMElement>)node attribute: @"name"] lowercaseString];
[filter setObject: [node textValue] forKey: componentName];
}
-134
View File
@@ -1,134 +0,0 @@
/*
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 "LDAPUserManager.h"
#include "common.h"
static void usage(NSArray *args) {
fprintf(stderr, "usage: %s <uid> read|write|info [<key>] [<value>]\n",
[[args objectAtIndex:0] cString]);
}
static void doInfo(NSUserDefaults *defaults) {
printf("defaults for: '%s'\n", [[defaults valueForKey:@"uid"] cString]);
printf(" profile table: '%s'\n",
[[[defaults valueForKey:@"tableURL"] absoluteString] cString]);
}
static void doRead(NSUserDefaults *defaults, NSString *key) {
id value;
if (key == nil) {
NSArray *defNames;
unsigned i, count;
defNames = [defaults valueForKey:@"primaryDefaultNames"];
if ((count = [defNames count]) == 0) {
fprintf(stderr, "There are no keys in the SOGo profile!\n");
return;
}
for (i = 0; i < count; i++) {
printf("%s: %s\n",
[[defNames objectAtIndex:i] cString],
[[[defaults objectForKey:[defNames objectAtIndex:i]]
description] cString]);
}
}
else if ((value = [defaults objectForKey:key]) == nil) {
fprintf(stderr, "There is no key '%s' in the SOGo profile!\n",
[key cString]);
}
else
printf("%s\n", [[value description] cString]);
}
static void doWrite(NSUserDefaults *defaults, NSString *key, NSString *value) {
[defaults setObject:value forKey:key];
if (![defaults synchronize]) {
fprintf(stderr, "Failed to synchronize defaults with profile!\n");
return;
}
}
static void doIt(NSArray *args) {
LDAPUserManager *userManager;
NSUserDefaults *defaults;
NSString *uid, *op, *key, *value;
/* extract arguments */
if ([args count] < 3) {
usage(args);
return;
}
uid = [args objectAtIndex:1];
op = [args objectAtIndex:2];
key = nil;
value = nil;
if ([args count] > 3)
key = [args objectAtIndex:3];
if ([op isEqualToString:@"write"]) {
if ([args count] < 5) {
usage(args);
return;
}
value = [args objectAtIndex:4];
}
/* run */
userManager = [LDAPUserManager 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 if ([op isEqualToString:@"info"])
doInfo(defaults);
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;
}
-71
View File
@@ -1,71 +0,0 @@
/*
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 "LDAPUserManager.h"
#include "common.h"
static void usage(NSArray *args) {
fprintf(stderr, "usage: %s <email1> <email2> <email3>\n",
[[args objectAtIndex:0] cString]);
}
static void doIt(NSArray *args) {
LDAPUserManager *userManager;
NSEnumerator *e;
NSString *email;
if ([args count] < 2) {
usage(args);
return;
}
userManager = [LDAPUserManager sharedUserManager];
e = [args objectEnumerator];
[e nextObject]; /* consume the command name */
while ((email = [e nextObject]) != nil) {
NSString *uid;
uid = [userManager getUIDForEmail:email];
if ([uid isNotNull])
printf("%s: %s\n", [email cString], [uid cString]);
else {
fprintf(stderr, "ERROR: did not find uid for email: '%s'\n",
[email cString]);
}
}
}
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;
}
-85
View File
@@ -1,85 +0,0 @@
/*
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 "LDAPUserManager.h"
#include "common.h"
static void usage(NSArray *args) {
fprintf(stderr, "usage: %s <uid1> <uid2> <uid3>\n",
[[args objectAtIndex:0] cString]);
}
static void handleUID(NSString *uid, LDAPUserManager *userManager) {
NSArray *emails;
NSString *primary;
unsigned i, count;
primary = [userManager getEmailForUID:uid];
emails = [userManager getSharedMailboxEMailsForUID:uid];
printf("%s:", [uid cString]);
if ([primary length] > 0)
printf(" %s\n", [primary cString]);
else
printf(" <no primary email found>\n");
if ((count = [emails count]) == 0) {
printf(" <no shares with emitter access>\n");
return;
}
for (i = 0; i < count; i++)
printf(" %s\n", [[emails objectAtIndex:i] cString]);
}
static void doIt(NSArray *args) {
LDAPUserManager *userManager;
NSEnumerator *e;
NSString *uid;
if ([args count] < 2) {
usage(args);
return;
}
userManager = [LDAPUserManager sharedUserManager];
e = [args objectEnumerator];
[e nextObject]; /* consume the command name */
while ((uid = [e nextObject]) != nil)
handleUID(uid, userManager);
}
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;
}
-79
View File
@@ -1,79 +0,0 @@
/*
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 "LDAPUserManager.h"
#include "common.h"
static void usage(NSArray *args) {
fprintf(stderr, "usage: %s <uid1> <uid2> <uid3>\n",
[[args objectAtIndex:0] cString]);
}
static void handleUID(NSString *uid, LDAPUserManager *userManager) {
NSArray *shares;
unsigned i, count;
shares = [userManager getSharedMailboxAccountStringsForUID:uid];
printf("%s:", [uid cString]);
if ((count = [shares count]) == 0) {
printf(" <no shares>\n");
return;
}
puts("");
for (i = 0; i < count; i++)
printf(" %s\n", [[shares objectAtIndex:i] cString]);
}
static void doIt(NSArray *args) {
LDAPUserManager *userManager;
NSEnumerator *e;
NSString *uid;
if ([args count] < 2) {
usage(args);
return;
}
userManager = [LDAPUserManager sharedUserManager];
e = [args objectEnumerator];
[e nextObject]; /* consume the command name */
while ((uid = [e nextObject]) != nil)
handleUID(uid, userManager);
}
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;
}