diff --git a/ChangeLog b/ChangeLog index 53a2270d6..3556ea464 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-09-12 Wolfgang Sourdeau + + * UI/MainUI/SOGoRootPage.m ([SOGoRootPage -defaultAction]): test + whether the user is logged in and if so, redirect to his/her + homepage. + ([SOGoRootPage -appendToResponse:inContext:]): removed useless + method. + 2007-09-11 Wolfgang Sourdeau * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index d4bdc2070..f0323e638 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -83,88 +83,24 @@ return response; } -// - (id ) defaultAction -// { -// WOResponse *r; -// NSString *login, *rhk; -// SOGoWebAuthenticator *auth; -// SOGoUser *user; -// SOGoUserFolder *home; -// WOApplication *base; +- (id ) defaultAction +{ + id response; + NSString *login, *oldLocation; -// /* -// Note: ctx.activeUser is NOT set here. Don't know why, so we retrieve -// the user from the authenticator. -// */ - -// auth = [[self clientObject] authenticatorInContext: context]; -// user = [auth userInContext: context]; -// login = [user login]; + login = [[context activeUser] login]; + if ([login isEqualToString: @"anonymous"]) + response = self; + else + { + oldLocation = [[self clientObject] baseURLInContext: context]; + response + = [self redirectToLocation: [NSString stringWithFormat: @"%@/%@", + oldLocation, login]]; + } -// if ([login isEqualToString:@"anonymous"]) { -// /* use root page for unauthenticated users */ -// return self; -// } - -// /* check base */ - -// base = [self application]; -// rhk = [[context request] requestHandlerKey]; -// if (([rhk length] == 0) || ([base requestHandlerForKey:rhk] == nil)) { -// base = [base lookupName: @"so" inContext: context acquire: NO]; - -// if (![base isNotNull] || [base isKindOfClass:[NSException class]]) { -// /* use root page if home could not be found */ -// [self errorWithFormat:@"Did not find 'so' request handler!"]; -// return self; -// } -// } - -// /* lookup home-page */ - -// home = [base lookupName: login inContext: context acquire: NO]; -// if (![home isNotNull] || [home isKindOfClass:[NSException class]]) { -// /* use root page if home could not be found */ -// return self; -// } - -// /* redirect to home-page */ - -// r = [context response]; -// [r setStatus: 302 /* moved */]; -// [r setHeader: [home baseURLInContext: context] -// forKey: @"location"]; - -// return r; -// } - -/* response generation */ - -// - (void) appendToResponse: (WOResponse *) response -// inContext: (WOContext *) ctx -// { -// NSString *rhk; - -// // TODO: we might also want to look into the HTTP basic-auth to redirect to -// // the login URL! - -// 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; -// } - -// [response setHeader: @"text/html" forKey: @"content-type"]; -// [super appendToResponse: response inContext: ctx]; -// } + return response; +} - (BOOL) isPublicInContext: (WOContext *) localContext { diff --git a/UI/WebServerResources/SOGoRootPage.css b/UI/WebServerResources/SOGoRootPage.css index fa534ef43..15d0c1f47 100644 --- a/UI/WebServerResources/SOGoRootPage.css +++ b/UI/WebServerResources/SOGoRootPage.css @@ -12,10 +12,10 @@ DIV#loginScreen background-color: #d4d0c8; margin: 0px auto; margin-top: 5em; - padding: 10px; + padding: 5px; border: 2px solid transparent; - width: 197px; - height: 300px; + width: 200px; + height: 315px; -moz-border-top-colors: #efebe7 #fff; -moz-border-left-colors: #efebe7 #fff; -moz-border-right-colors: #000 #9c9a94 transparent; @@ -26,8 +26,8 @@ DIV#loginScreen IMG { border: 0px; margin: 0px; padding: 0px; - height: 192px; - width: 192px; } + height: 200px; + width: 200px; } DIV#loginScreen INPUT.textField { width: 187px; } diff --git a/UI/WebServerResources/lori-login.jpg b/UI/WebServerResources/lori-login.jpg index a8947edb4..7ab42d121 100644 Binary files a/UI/WebServerResources/lori-login.jpg and b/UI/WebServerResources/lori-login.jpg differ