diff --git a/ChangeLog b/ChangeLog index 10d2f7a77..de6453b68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-01-26 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoAuthenticator.m ([SOGoAuthenticator + -userInContext:]): if the lookup is on "freebusy.ifb" and the + username is "anonymous" the user is automatically set to + "freebusy". + 2007-01-12 Wolfgang Sourdeau * SoObjects/SOGo/SOGoAuthenticator.m ([SOGoAuthenticator diff --git a/OGoContentStore/GNUmakefile b/OGoContentStore/GNUmakefile index 1b09057cf..5807b690d 100644 --- a/OGoContentStore/GNUmakefile +++ b/OGoContentStore/GNUmakefile @@ -7,7 +7,7 @@ include ./Version LIBRARY_NAME = libOGoContentStore TOOL_NAME = test_quick_extract -TYPEMODELS_DIR = $(GNUSTEP_USER_ROOT)/Library/OCSTypeModels/ +TYPEMODELS_DIR = $(GNUSTEP_SYSTEM_ROOT)/Library/OCSTypeModels/ libOGoContentStore_HEADER_FILES_DIR = . libOGoContentStore_HEADER_FILES_INSTALL_DIR = /OGoContentStore diff --git a/SoObjects/SOGo/SOGoAuthenticator.m b/SoObjects/SOGo/SOGoAuthenticator.m index 0aa6552e5..a44d55325 100644 --- a/SoObjects/SOGo/SOGoAuthenticator.m +++ b/SoObjects/SOGo/SOGoAuthenticator.m @@ -94,32 +94,39 @@ static SOGoAuthenticator *auth = nil; - (SoUser *) userInContext:(WOContext *)_ctx { static SoUser *anonymous = nil, *freebusy; - NSString *login; - + SoUser *user; + NSArray *traversalPath; + NSString *login; + if (!anonymous) anonymous = [[SOGoUser alloc] initWithLogin:@"anonymous" roles: [NSArray arrayWithObject: SoRole_Anonymous]]; - if (!freebusy) freebusy = [[SOGoUser alloc] initWithLogin: @"freebusy" roles: [NSArray arrayWithObject: SOGoRole_FreeBusy]]; - if ((login = [self checkCredentialsInContext:_ctx]) == nil) - /* some error (otherwise result would have been anonymous */ - return nil; - - if ([login isEqualToString: @"anonymous"]) - return anonymous; - else if ([login isEqualToString: @"freebusy"]) - return freebusy; + login = [self checkCredentialsInContext:_ctx]; + if (login) + { + if ([login isEqualToString: @"anonymous"]) + { + traversalPath = [_ctx objectForKey: @"SoRequestTraversalPath"]; + if ([[traversalPath lastObject] isEqualToString: @"freebusy.ifb"]) + user = freebusy; + else + user = anonymous; + } + else + user = [[[SOGoUser alloc] initWithLogin: login + roles: [self rolesForLogin: login]] + autorelease]; + } + else + user = nil; -// uroles = [NSMutableArray arrayWithArray: ]; - - return [[[SOGoUser alloc] initWithLogin: login - roles: [self rolesForLogin: login]] - autorelease]; + return user; } // - (BOOL) renderException: (NSException *) exception