From ee0fefff006fc036f626840a590f2d44a0ac7c90 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Tue, 4 Sep 2007 22:05:16 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1166 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 3 +++ Main/SOGo.m | 4 ++-- SoObjects/SOGo/SOGoDAVAuthenticator.m | 29 ------------------------- SoObjects/SOGo/SOGoWebAuthenticator.m | 31 +-------------------------- UI/MainUI/SOGoUserHomePage.m | 1 + UI/Templates/MainUI/SOGoRootPage.wox | 1 + UI/WebServerResources/SOGoRootPage.js | 3 ++- 7 files changed, 10 insertions(+), 62 deletions(-) diff --git a/ChangeLog b/ChangeLog index 012f73bf..d542f488 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-09-04 Wolfgang Sourdeau + * UI/MainUI/SOGoUserHomePage.m ([SOGoUserHomePage -logoffAction]): + set the cookie path to "/". + * Main/SOGo.m ([SOGo -authenticatorInContext:_ctx]): choose the authenticator based on the request handler key. "dav" returns the SOGoDAVAuthenticator, anything else returns the Web authenticator. diff --git a/Main/SOGo.m b/Main/SOGo.m index 52c2a0d7..dc5065f7 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -232,12 +232,12 @@ static BOOL debugObjectAllocation = NO; /* authenticator */ -- (id) authenticatorInContext: (id) _ctx +- (id) authenticatorInContext: (WOContext *) context { id authenticator; NSString *key; - key = [[_ctx request] requestHandlerKey]; + key = [[context request] requestHandlerKey]; if ([key isEqualToString: @"dav"]) authenticator = [SOGoDAVAuthenticator sharedSOGoDAVAuthenticator]; else diff --git a/SoObjects/SOGo/SOGoDAVAuthenticator.m b/SoObjects/SOGo/SOGoDAVAuthenticator.m index 2380e672..d52f5740 100644 --- a/SoObjects/SOGo/SOGoDAVAuthenticator.m +++ b/SoObjects/SOGo/SOGoDAVAuthenticator.m @@ -135,33 +135,4 @@ return user; } -// - (BOOL) renderException: (NSException *) exception -// inContext: (WOContext *) context -// { -// id renderedException; -// WOComponent *tmpComponent; -// WOResponse *response; -// BOOL rc; - -// rc = [super renderException: exception inContext: context]; -// if (!rc) -// { -// tmpComponent = [WOComponent new]; -// renderedException = [tmpComponent pageWithName: @"UIxException"]; -// if (renderedException) -// { -// rc = YES; -// response = [context response]; -// [response setHeader: @"text/html" forKey: @"content-type"]; -// [renderedException setClientObject: exception]; -// [context setPage: renderedException]; -// [renderedException appendToResponse: response -// inContext: context]; -// } -// [tmpComponent release]; -// } - -// return rc; -// } - @end /* SOGoDAVAuthenticator */ diff --git a/SoObjects/SOGo/SOGoWebAuthenticator.m b/SoObjects/SOGo/SOGoWebAuthenticator.m index 2ab8cb6e..9bd84e2a 100644 --- a/SoObjects/SOGo/SOGoWebAuthenticator.m +++ b/SoObjects/SOGo/SOGoWebAuthenticator.m @@ -121,37 +121,8 @@ id page; page = [[WOApplication application] pageWithName: @"SOGoRootPage" - inContext: context]; + forRequest: [context request]]; [page appendToResponse: response inContext: context]; } -// - (BOOL) renderException: (NSException *) exception -// inContext: (WOContext *) context -// { -// id renderedException; -// WOComponent *tmpComponent; -// WOResponse *response; -// BOOL rc; - -// rc = [super renderException: exception inContext: context]; -// if (!rc) -// { -// tmpComponent = [WOComponent new]; -// renderedException = [tmpComponent pageWithName: @"UIxException"]; -// if (renderedException) -// { -// rc = YES; -// response = [context response]; -// [response setHeader: @"text/html" forKey: @"content-type"]; -// [renderedException setClientObject: exception]; -// [context setPage: renderedException]; -// [renderedException appendToResponse: response -// inContext: context]; -// } -// [tmpComponent release]; -// } - -// return rc; -// } - @end /* SOGoWebAuthenticator */ diff --git a/UI/MainUI/SOGoUserHomePage.m b/UI/MainUI/SOGoUserHomePage.m index 572ee1aa..6f211ce6 100644 --- a/UI/MainUI/SOGoUserHomePage.m +++ b/UI/MainUI/SOGoUserHomePage.m @@ -218,6 +218,7 @@ static NSString *defaultModule = nil; auth = [[self clientObject] authenticatorInContext: context]; cookie = [WOCookie cookieWithName: [auth cookieNameInContext: context] value: @"logoff"]; + [cookie setPath: @"/"]; [response addCookie: cookie]; return response; diff --git a/UI/Templates/MainUI/SOGoRootPage.wox b/UI/Templates/MainUI/SOGoRootPage.wox index 314b97f8..c5f08cbd 100644 --- a/UI/Templates/MainUI/SOGoRootPage.wox +++ b/UI/Templates/MainUI/SOGoRootPage.wox @@ -30,6 +30,7 @@ diff --git a/UI/WebServerResources/SOGoRootPage.js b/UI/WebServerResources/SOGoRootPage.js index dd93cb3b..7e311008 100644 --- a/UI/WebServerResources/SOGoRootPage.js +++ b/UI/WebServerResources/SOGoRootPage.js @@ -9,7 +9,8 @@ function onLoginClick(event) { startAnimation($("loginButton"), $("submit")); var loginString = $("userName").value + ":" + $("password").value; - document.cookie = "0xHIGHFLYxSOGo-0.9 = basic" + loginString.base64encode(); + document.cookie = ("0xHIGHFLYxSOGo-0.9 = basic" + loginString.base64encode() + + "; path=/"); } addEvent(window, 'load', initLogin); -- 2.39.5