Monotone-Parent: 9ef1fb2c66953b8ada0d55d0eec183621a71ebab
Monotone-Revision: dc5f7b2c31d9e41fc7a1cb9e62c39060dca4d576 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-09-12T13:01:17 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
9a679ba49c
commit
1ed3955bd0
|
@ -1,3 +1,11 @@
|
|||
2007-09-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* 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 <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder
|
||||
|
|
|
@ -83,88 +83,24 @@
|
|||
return response;
|
||||
}
|
||||
|
||||
// - (id <WOActionResults>) defaultAction
|
||||
// {
|
||||
// WOResponse *r;
|
||||
// NSString *login, *rhk;
|
||||
// SOGoWebAuthenticator *auth;
|
||||
// SOGoUser *user;
|
||||
// SOGoUserFolder *home;
|
||||
// WOApplication *base;
|
||||
- (id <WOActionResults>) defaultAction
|
||||
{
|
||||
id <WOActionResults> 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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue