/*
- Copyright (C) 2000-2004 SKYRIX Software AG
+ Copyright (C) 2000-2005 SKYRIX Software AG
- This file is part of OpenGroupware.org.
+ This file is part of SOPE.
- OGo is free software; you can redistribute it and/or modify it under
+ SOPE is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+ SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING. If not, write to the
+ License along with SOPE; see the file COPYING. If not, write to the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
NSDateClass = [NSDate class];
lm = [NGLoggerManager defaultLoggerManager];
- logger = [lm loggerForClass:self];
+ logger = [lm loggerForDefaultKey:@"WODebuggingEnabled"];
perfLogger = [lm loggerForDefaultKey:@"WOProfileRequestHandler"];
ud = [NSUserDefaults standardUserDefaults];
if (session != nil) {
if ([session storesIDsInCookies]) {
- [self debugWithFormat:@"add cookie to session: %@", session];
+ if (logger != nil) /* Note: required! do not remove */
+ [self debugWithFormat:@"add cookie to session: %@", session];
[self addCookiesForSession:session
toResponse:response
inContext:context];
toResponse:(WOResponse *)_response
inContext:(WOContext *)_ctx
{
- if ([_sn storesIDsInCookies]) {
- WOApplication *app;
- NSString *cookieName = nil;
- WOCookie *cookie = nil;
- NSString *uri;
- NSString *value;
-
- app = [WOApplication application];
- cookieName = [app name];
-
- if (!doNotSetCookiePath) {
- NSString *tmp;
+ WOApplication *app;
+ WOCookie *cookie = nil;
+ NSString *uri;
+ NSString *value;
+
+ if (![_sn storesIDsInCookies])
+ return;
+
+ app = [WOApplication application];
+
+ // TODO: there is a DUP of this section in OpenGroupware.m to set an
+ // expiration cookie
+ if (!doNotSetCookiePath) {
+ NSString *tmp;
- if ((uri = [[_ctx request] applicationName]) == nil)
- uri = [app name];
- uri = [@"/" stringByAppendingString:uri];
- if ((tmp = [[_ctx request] adaptorPrefix]))
- uri = [tmp stringByAppendingString:uri];
- }
- else
- uri = @"/";
-
-#if 0
- uri = [_ctx urlSessionPrefix];
- uri = [_ctx urlWithRequestHandlerKey:
- [WOApplication componentRequestHandlerKey]
- path:@"/"
- queryString:nil];
+ if ((uri = [[_ctx request] applicationName]) == nil)
+ uri = [app name];
+ uri = [@"/" stringByAppendingString:uri];
+ if ((tmp = [[_ctx request] adaptorPrefix]))
+ uri = [tmp stringByAppendingString:uri];
+ }
+ else
+ uri = @"/";
+
+#if 0 // TODO: explain!
+ uri = [_ctx urlSessionPrefix];
+ uri = [_ctx urlWithRequestHandlerKey:
+ [WOApplication componentRequestHandlerKey]
+ path:@"/"
+ queryString:nil];
#endif
- value = [_sn isTerminating]
- ? (id)@"nil"
- : [_sn sessionID];
+ value = [_sn isTerminating]
+ ? (id)@"nil"
+ : [_sn sessionID];
- cookie = [WOCookie cookieWithName:cookieName
- value:value
- path:uri
- domain:[_sn domainForIDCookies]
- expires:[_sn expirationDateForIDCookies]
- isSecure:NO];
- if (cookie)
- [_response addCookie:cookie];
- }
+ cookie = [WOCookie cookieWithName:[app name]
+ value:value
+ path:uri
+ domain:[_sn domainForIDCookies]
+ expires:[_sn expirationDateForIDCookies]
+ isSecure:NO];
+ if (cookie != nil)
+ [_response addCookie:cookie];
}
@end /* WORequestHandler(Cookies) */