]> err.no Git - scalable-opengroupware.org/blobdiff - UI/MainUI/SOGoUserHomePage.m
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1170 d1b88da0-ebda-0310...
[scalable-opengroupware.org] / UI / MainUI / SOGoUserHomePage.m
index 410753ec8e375e32b8733666a37c7a99bfe922cb..910155833657e00b828dfd829a45025f7c4a8425 100644 (file)
 #import <Foundation/NSURL.h>
 #import <Foundation/NSUserDefaults.h>
 #import <Foundation/NSValue.h>
+#import <NGObjWeb/WOCookie.h>
 #import <NGObjWeb/WORequest.h>
 #import <NGObjWeb/WOResponse.h>
 #import <NGExtensions/NSCalendarDate+misc.h>
 #import <NGExtensions/NSObject+Logs.h>
 
 #import <Appointments/SOGoFreeBusyObject.h>
-#import <SOGo/SOGoUser.h>
-#import <SOGo/NSCalendarDate+SOGo.h>
+#import <SoObjects/SOGo/SOGoWebAuthenticator.h>
+#import <SoObjects/SOGo/SOGoUser.h>
+#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
 #import <SOGoUI/UIxComponent.h>
 
 static NSString *defaultModule = nil;
@@ -198,4 +200,29 @@ static NSString *defaultModule = nil;
   return response;
 }
 
+- (id <WOActionResults>) logoffAction
+{
+  WOResponse *response;
+  WOCookie *cookie;
+  SOGoWebAuthenticator *auth;
+  id container;
+  NSCalendarDate *date;
+
+  container = [[self clientObject] container];
+
+  response = [context response];
+  [response setStatus: 302];
+  [response setHeader: [container baseURLInContext: context]
+           forKey: @"location"];
+  auth = [[self clientObject] authenticatorInContext: context];
+  cookie = [WOCookie cookieWithName: [auth cookieNameInContext: context]
+                    value: @"discard"];
+  [cookie setPath: @"/"];
+  date = [NSCalendarDate calendarDate];
+  [cookie setExpires: [date yesterday]];
+  [response addCookie: cookie];
+
+  return response;
+}
+
 @end