+2005-07-12 Helge Hess <helge.hess@opengroupware.org>
+
+ * v0.9.30
+
+ * SOGoAuthenticator.m: create SOGoUser objects
+
+ * added 'SOGoUser' object/class as a subclass of SoUser, using this
+ object various Agenor properties like cn or email can be determined
+ (will use the AgenorUserManager to retrieve such)
+
2005-07-08 Marcus Mueller <znek@mulle-kybernetik.com>
* README: updated for new default 'SOGoAllowsUnrestrictedAccess'
SOGo.m \
SOGoProductLoader.m \
SOGoAuthenticator.m \
+ SOGoUser.m \
# product
/*
- Copyright (C) 2004 SKYRIX Software AG
+ Copyright (C) 2004-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#ifndef __Main_SOGoAuthenticator_H__
#define __Main_SOGoAuthenticator_H__
*/
#include "SOGoAuthenticator.h"
+#include "SOGoUser.h"
#include "common.h"
@implementation SOGoAuthenticator
return YES;
}
+/* create SOGoUser */
+
+- (SoUser *)userInContext:(WOContext *)_ctx {
+ static SoUser *anonymous = nil;
+ NSString *login;
+ NSArray *uroles;
+
+ if (anonymous == nil) {
+ NSArray *ar = [NSArray arrayWithObject:SoRole_Anonymous];
+ anonymous = [[SOGoUser alloc] initWithLogin:@"anonymous" roles:ar];
+ }
+
+ if ((login = [self checkCredentialsInContext:_ctx]) == nil)
+ /* some error (otherwise result would have been anonymous */
+ return nil;
+
+ if ([login isEqualToString:@"anonymous"])
+ return anonymous;
+
+ uroles = [self rolesForLogin:login];
+ return [[[SOGoUser alloc] initWithLogin:login roles:uroles] autorelease];
+}
+
@end /* SOGoAuthenticator */
--- /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 __SOGoUser_H__
+#define __SOGoUser_H__
+
+#include <NGObjWeb/SoUser.h>
+
+/*
+ SOGoUser
+
+ This adds some additional SOGo properties to the SoUser object. The
+ properties are (currently) looked up using the AgenorUserManager.
+*/
+
+@class NSString, NSURL;
+
+@interface SOGoUser : SoUser
+{
+ NSString *cn;
+ NSString *email;
+}
+
+/* properties */
+
+- (NSString *)email;
+- (NSString *)cn;
+- (NSString *)primaryIMAP4AccountString;
+- (NSString *)primaryMailServer;
+- (NSArray *)additionalIMAP4AccountStrings;
+- (NSArray *)additionalEMailAddresses;
+- (NSURL *)freeBusyURL;
+
+@end
+
+#endif /* __SOGoUser_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 "SOGoUser.h"
+#include <SOGo/AgenorUserManager.h>
+#include "common.h"
+
+@implementation SOGoUser
+
+- (void)dealloc {
+ [self->cn release];
+ [self->email release];
+ [super dealloc];
+}
+
+/* internals */
+
+- (AgenorUserManager *)userManager {
+ static AgenorUserManager *um = nil;
+ if (um == nil) um = [[AgenorUserManager sharedUserManager] retain];
+ return um;
+}
+
+/* properties */
+
+- (NSString *)email {
+ if (self->email == nil)
+ self->email = [[[self userManager] getEmailForUID:[self login]] copy];
+ return self->email;
+}
+
+- (NSString *)cn {
+ if (self->cn == nil)
+ self->cn = [[[self userManager] getCNForUID:[self login]] copy];
+ return self->cn;
+}
+
+- (NSString *)primaryIMAP4AccountString {
+ return [[self userManager] getIMAPAccountStringForUID:[self login]];
+}
+- (NSString *)primaryMailServer {
+ return [[self userManager] getServerForUID:[self login]];
+}
+
+- (NSArray *)additionalIMAP4AccountStrings {
+ return [[self userManager]getSharedMailboxAccountStringsForUID:[self login]];
+}
+- (NSArray *)additionalEMailAddresses {
+ return [[self userManager] getSharedMailboxEMailsForUID:[self login]];
+}
+
+- (NSURL *)freeBusyURL {
+ return [[self userManager] getFreeBusyURLForUID:[self login]];
+}
+
+@end /* SOGoUser */
# Version file
-SUBMINOR_VERSION:=29
+SUBMINOR_VERSION:=30
# v0.9.24 requires libWEExtensions v4.5.67
# v0.9.16 requires libNGExtensions v4.5.136
<tr>
<td valign="top" align="left">
<font class="defaultfont"><var:entity const:name="copy"/>
- 2000-2004 <a href="http://www.skyrix.com:80/knoppix/skyrix/"
+ 2004-2005 <a href="http://www.skyrix.com:80/knoppix/skyrix/"
target="SKYRIX"
>SKYRIX Software AG</a>.
We welcome your