diff --git a/ChangeLog b/ChangeLog index 933a28faf..7428f934f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2010-06-10 Wolfgang Sourdeau + * UI/Common/UIxPageFrame.m (-canLogoff)): return YES when the + authentication type is set to "cas" and SOGoCASLogoutEnabled is + set. + (-logoffPath): return an href to the CAS service logout URL when + using "cas" as authentication type. + * SoObjects/SOGo/SOGoSystemDefaults.m (-CASLogoutEnabled): new method that returns whether the "SOGoCASLogoutEnabled" ud is set. diff --git a/UI/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index 1cc77b685..dd0cb5b7f 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -26,6 +26,7 @@ #import #import +#import #import #import #import @@ -155,7 +156,18 @@ - (NSString *) logoffPath { - return [self relativePathToUserFolderSubPath: @"logoff"]; + NSString *logoffPath; + SOGoSystemDefaults *sd; + + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if ([[sd authenticationType] isEqualToString: @"cas"]) + logoffPath = [[sd CASServiceURL] composeURLWithAction: @"logout" + parameters: nil + andHash: NO]; + else + logoffPath = [self relativePathToUserFolderSubPath: @"logoff"]; + + return logoffPath; } /* popup handling */ @@ -416,8 +428,9 @@ if ([auth respondsToSelector: @selector (cookieNameInContext:)]) { sd = [SOGoSystemDefaults sharedSystemDefaults]; - canLogoff = ([[auth cookieNameInContext: context] length] > 0 - && ![[sd authenticationType] isEqualToString: @"cas"]); + canLogoff = (([[sd authenticationType] isEqualToString: @"cas"] + && [sd CASLogoutEnabled]) + || [[auth cookieNameInContext: context] length] > 0); } else canLogoff = NO;