Monotone-Parent: 78e8177b7871651ba9b05f971e1b40376fb5e49d

Monotone-Revision: 8e4f10d6d171bd7c241c05d63d20efa7f2a66de4

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-09-11T14:38:43
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-09-11 14:38:43 +00:00
parent b5dfe674de
commit 7bb57b4692
15 changed files with 367 additions and 42 deletions
+18 -3
View File
@@ -25,9 +25,10 @@
#import <NGObjWeb/WOResourceManager.h>
#import <SoObjects/SOGo/SOGoUser.h>
#import <SoObjects/SOGo/SOGoUserDefaults.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <SOGo/SOGoWebAuthenticator.h>
#import "UIxPageFrame.h"
@@ -389,6 +390,20 @@ static NSString *siteFavicon = nil;
&& [user isSuperUser]);
}
- (BOOL) canLogoff
{
BOOL canLogoff;
id auth;
auth = [[self clientObject] authenticatorInContext: context];
if ([auth respondsToSelector: @selector (cookieNameInContext:)])
canLogoff = ([[auth cookieNameInContext: context] length] > 0);
else
canLogoff = NO;
return canLogoff;
}
- (BOOL) userHasCalendarAccess
{
SOGoUser *user;
+2 -1
View File
@@ -121,7 +121,8 @@ static NSArray *supportedLanguages = nil;
oldLocation = [[self clientObject] baseURLInContext: context];
response
= [self redirectToLocation: [NSString stringWithFormat: @"%@/%@",
oldLocation, login]];
oldLocation,
[login stringByEscapingURL]]];
}
return response;
+16 -10
View File
@@ -270,7 +270,7 @@ static NSString *LDAPContactInfoAttribute = nil;
SOGoWebAuthenticator *auth;
id container;
NSCalendarDate *date;
NSString *userName;
NSString *userName, *cookieName;
container = [[self clientObject] container];
@@ -281,21 +281,27 @@ static NSString *LDAPContactInfoAttribute = nil;
[response setStatus: 302];
[response setHeader: [container baseURLInContext: context]
forKey: @"location"];
auth = [[self clientObject] authenticatorInContext: context];
date = [NSCalendarDate calendarDate];
[date setTimeZone: [NSTimeZone timeZoneWithAbbreviation: @"GMT"]];
cookie = [WOCookie cookieWithName: [auth cookieNameInContext: context]
value: @"discard"];
[cookie setPath: @"/"];
[cookie setExpires: [date yesterday]];
[response addCookie: cookie];
auth = [[self clientObject] authenticatorInContext: context];
if ([auth respondsToSelector: @selector (cookieNameInContext:)])
cookieName = [auth cookieNameInContext: context];
else
cookieName = nil;
if (cookieName)
{
cookie = [WOCookie cookieWithName: cookieName value: @"discard"];
[cookie setPath: @"/"];
[cookie setExpires: [date yesterday]];
[response addCookie: cookie];
}
[response setHeader: [date rfc822DateString] forKey: @"Last-Modified"];
[response setHeader: @"no-store, no-cache, must-revalidate, max-age=0"
forKey: @"Cache-Control"];
[response setHeader: @"post-check=0, pre-check=0" forKey: @"Cache-Control"];
[response setHeader: @"no-store, no-cache, must-revalidate."
@" max-age=0, post-check=0, pre-check=0"
forKey: @"Cache-Control"];
[response setHeader: @"no-cache" forKey: @"Pragma"];
return response;
+4 -2
View File
@@ -46,8 +46,10 @@
><var:if condition="context.isUIxDebugEnabled"
><div id="logConsole"><!-- space --></div></var:if>
<div id="linkBanner" class="linkbanner">
<a id="logoff" var:href="logoffPath"
><var:string label:value="Disconnect" /></a>
<var:if condition="canLogoff"
><a id="logoff" var:href="logoffPath"
><var:string label:value="Disconnect" /></a
></var:if>
<var:if condition="userHasCalendarAccess">
<var:if condition="isCalendar">
<span class="active"><var:string label:value="Calendar"