From c555bf858bc28b55a906233d499f3d8d66f31396 Mon Sep 17 00:00:00 2001 From: helge Date: Wed, 30 Jun 2004 08:20:19 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/trunk@93 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/Main/GNUmakefile | 10 +++-- SOGo/Main/README | 12 ++++++ SOGo/Main/SOGoRootPage.m | 75 ++++++++++++++++++++++++++++++++++++++ SOGo/Main/SOGoRootPage.wox | 20 ++++++++++ SOGo/Main/product.plist | 13 +++++++ SOGo/Main/sogod.m | 2 + 6 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 SOGo/Main/README create mode 100644 SOGo/Main/SOGoRootPage.m create mode 100644 SOGo/Main/SOGoRootPage.wox diff --git a/SOGo/Main/GNUmakefile b/SOGo/Main/GNUmakefile index ffdb1401..b47ba64e 100644 --- a/SOGo/Main/GNUmakefile +++ b/SOGo/Main/GNUmakefile @@ -8,10 +8,14 @@ sogod_OBJC_FILES += \ sogod.m \ SOGoProductLoader.m \ SOGoAuthenticator.m \ + \ + SOGoRootPage.m \ -sogod_RESOURCE_FILES += \ - Version \ - product.plist \ +sogod_RESOURCE_FILES += \ + Version \ + product.plist \ + \ + SOGoRootPage.wox \ sogod_WEBSERVER_RESOURCE_FILES += diff --git a/SOGo/Main/README b/SOGo/Main/README new file mode 100644 index 00000000..4441bfef --- /dev/null +++ b/SOGo/Main/README @@ -0,0 +1,12 @@ +# $Id$ + +SOGo +==== + +Master Daemon, loads the functionality from product bundles in Library/SOGo. + +Setup +===== + + Defaults write sogod NGBundlePath '""' + => otherwise some bundles will clash with "fat" OGo diff --git a/SOGo/Main/SOGoRootPage.m b/SOGo/Main/SOGoRootPage.m new file mode 100644 index 00000000..80d25ac0 --- /dev/null +++ b/SOGo/Main/SOGoRootPage.m @@ -0,0 +1,75 @@ +// $Id$ + +#include + +@interface SOGoRootPage : SoComponent +{ + NSString *userName; +} + +@end + +#include "common.h" + +@implementation SOGoRootPage + +- (id)initWithContext:(id)_ctx { + if ((self = [super initWithContext:_ctx])) { + } + return self; +} + +- (void)dealloc { + [self->userName release]; + [super dealloc]; +} + +/* accessors */ + +- (void)setUserName:(NSString *)_value { + ASSIGNCOPY(self->userName, _value); +} +- (NSString *)userName { + return self->userName; +} + +/* actions */ + +- (id)connectAction { + NSString *url; + + [self takeFormValuesForKeys:@"userName", nil]; + + if ([[self userName] length] == 0) + return nil; + + url = [@"/" stringByAppendingString:[[self userName] stringByEscapingURL]]; + if (![url hasSuffix:@"/"]) + url = [url stringByAppendingString:@"/"]; + + url = [[self context] urlWithRequestHandlerKey:@"so" + path:url queryString:nil]; + return [self redirectToLocation:url]; +} + +/* response generation */ + +- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { + NSString *rhk; + + rhk = [[_ctx request] requestHandlerKey]; + if ([rhk length]==0 || [[self application] requestHandlerForKey:rhk]==nil) { + /* a small hack to redirect to a valid URL */ + NSString *url; + + url = [_ctx urlWithRequestHandlerKey:@"so" path:@"/" queryString:nil]; + [_response setStatus:302 /* moved */]; + [_response setHeader:url forKey:@"location"]; + [self logWithFormat:@"URL: %@", url]; + return; + } + + [super appendToResponse:_response inContext:_ctx]; +} + +@end /* SOGoRootPage */ diff --git a/SOGo/Main/SOGoRootPage.wox b/SOGo/Main/SOGoRootPage.wox new file mode 100644 index 00000000..771354cc --- /dev/null +++ b/SOGo/Main/SOGoRootPage.wox @@ -0,0 +1,20 @@ + + + + Scalable OGo Homepage + + + +

Scalable OGo Homepage

+ +
+ Login: + + +
+ + diff --git a/SOGo/Main/product.plist b/SOGo/Main/product.plist index f8c27189..cbec188c 100644 --- a/SOGo/Main/product.plist +++ b/SOGo/Main/product.plist @@ -12,6 +12,19 @@ "WebDAV Access" = "Authenticated"; }; methods = { + index = { + protectedBy = "View"; + pageName = "SOGoRootPage"; + }; + GET = { // more or less a hack, see README of dbd + protectedBy = "View"; + pageName = "SOGoRootPage"; + }; + connect = { + protectedBy = "View"; + pageName = "SOGoRootPage"; + actionName = "connect"; + }; }; }; }; diff --git a/SOGo/Main/sogod.m b/SOGo/Main/sogod.m index 82b95fd4..94bbd390 100644 --- a/SOGo/Main/sogod.m +++ b/SOGo/Main/sogod.m @@ -56,11 +56,13 @@ static unsigned int vMemSizeLimit = 0; if ((self = [super init])) { [[SOGoProductLoader productLoader] loadProducts]; +#if 0 /* enable, if we added the value class */ /* setup some WebDAV type mappings required for Evolution */ [EOQualifier registerValueClass:NSClassFromString(@"dateTime") forTypeName:@"dateTime"]; [EOQualifier registerValueClass:NSClassFromString(@"dateTime") forTypeName:@"dateTime.tz"]; +#endif } return self; -- 2.39.5