diff --git a/ChangeLog b/ChangeLog index 36c74f8b1..ee4e1a04f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-08-26 Wolfgang Sourdeau + * UI/MainUI/SOGoRootPage.m ([SOGoRootPage -setUserName:_value]) + ([SOGoRootPage -userName]): removed accessors, since the + corresponding ivar is not used and was removed too. + + * UI/SOGoUI/UIxComponent.m ([-shortUserNameForDisplay]): no longer + make use of the "wrongusernamepassword" hack. + + * UI/MainUI/SOGoRootPage.m ([SOGoRootPage -connectAction]): return + HTTP code 403 if the username and the password passed in the + request are not valid. + * SoObjects/SOGo/SOGoUserFolder.m ([SOGoUserFolder -lookupName:_keyinContext:_ctxacquire:_flag]): whenever a user has no access to the specified module, a response with code 403 and diff --git a/UI/MainUI/SOGoRootPage.h b/UI/MainUI/SOGoRootPage.h index 387e11cd7..045d5d888 100644 --- a/UI/MainUI/SOGoRootPage.h +++ b/UI/MainUI/SOGoRootPage.h @@ -26,9 +26,6 @@ #import @interface SOGoRootPage : UIxComponent -{ - NSString *userName; -} @end diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index c47d8c8dc..b41ad202a 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -46,24 +46,8 @@ @implementation SOGoRootPage -- (void) dealloc -{ - [userName release]; - [super dealloc]; -} - /* accessors */ -- (void) setUserName: (NSString *) _value -{ - ASSIGNCOPY (userName, _value); -} - -- (NSString *) userName -{ - return userName; -} - - (NSString *) connectURL { return [NSString stringWithFormat: @"%@connect", [self applicationPath]]; @@ -77,20 +61,27 @@ WOCookie *authCookie; SOGoWebAuthenticator *auth; NSString *cookieValue, *cookieString; + NSString *userName, *password; auth = [[WOApplication application] authenticatorInContext: context]; request = [context request]; - response = [self responseWith204]; - cookieString = [NSString stringWithFormat: @"%@:%@", - [request formValueForKey: @"userName"], - [request formValueForKey: @"password"]]; - cookieValue = [NSString stringWithFormat: @"basic %@", - [cookieString stringByEncodingBase64]]; - authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context] - value: cookieValue]; - [authCookie setPath: @"/"]; - [response addCookie: authCookie]; + userName = [request formValueForKey: @"userName"]; + password = [request formValueForKey: @"password"]; + if ([auth checkLogin: userName password: password]) + { + response = [self responseWith204]; + cookieString = [NSString stringWithFormat: @"%@:%@", + userName, password]; + cookieValue = [NSString stringWithFormat: @"basic %@", + [cookieString stringByEncodingBase64]]; + authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context] + value: cookieValue]; + [authCookie setPath: @"/"]; + [response addCookie: authCookie]; + } + else + response = [self responseWithStatus: 403]; return response; } diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index b64b5f02b..0417b4f0e 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -446,9 +446,6 @@ static BOOL uixDebugEnabled = NO; - (NSString *) shortUserNameForDisplay { - if ([context activeUser] == nil) - return @"wrongusernamepassword"; - return [[context activeUser] login]; } diff --git a/UI/Templates/MainUI/SOGoRootPage.wox b/UI/Templates/MainUI/SOGoRootPage.wox index fd37387d3..8e281e830 100644 --- a/UI/Templates/MainUI/SOGoRootPage.wox +++ b/UI/Templates/MainUI/SOGoRootPage.wox @@ -7,6 +7,7 @@ xmlns:const="http://www.skyrix.com/od/constant" xmlns:rsrc="OGo:url" xmlns:label="OGo:label" + const:popup="YES" >
@@ -14,9 +15,8 @@ type="text/javascript">var loginSuffix = '';

-

-