Monotone-Parent: c0283461e792310f219134254634aca1351aec58
Monotone-Revision: 3e6948059832484bb80a8445b88f9673d85ac1ba Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-20T20:17:01 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
5f86e04f2f
commit
9dd4c2c014
|
@ -20,6 +20,7 @@ $(SOGOD)_OBJC_FILES += \
|
|||
sogod.m \
|
||||
SOGo.m \
|
||||
SOGoProductLoader.m \
|
||||
SOGoStartupLogger.m \
|
||||
build.m
|
||||
|
||||
-include GNUmakefile.preamble
|
||||
|
|
10
Main/SOGo.m
10
Main/SOGo.m
|
@ -59,12 +59,7 @@
|
|||
#import "NSException+Stacktrace.h"
|
||||
|
||||
#import "SOGo.h"
|
||||
|
||||
@interface SOGoStartupLogger : NSObject
|
||||
@end
|
||||
|
||||
@implementation SOGoStartupLogger
|
||||
@end
|
||||
#import "SOGoStartupLogger.h"
|
||||
|
||||
@implementation SOGo
|
||||
|
||||
|
@ -88,7 +83,7 @@ static BOOL debugLeaks = NO;
|
|||
SOGoStartupLogger *logger;
|
||||
id tmp;
|
||||
|
||||
logger = [SOGoStartupLogger new];
|
||||
logger = [SOGoStartupLogger sharedLogger];
|
||||
[logger logWithFormat: @"starting SOGo (build %@)", SOGoBuildDate];
|
||||
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
|
@ -132,7 +127,6 @@ static BOOL debugLeaks = NO;
|
|||
|
||||
trustProxyAuthentication = [ud boolForKey: @"SOGoTrustProxyAuthentication"];
|
||||
useRelativeURLs = [ud boolForKey: @"WOUseRelativeURLs"];
|
||||
[logger release];
|
||||
}
|
||||
|
||||
- (id) init
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/* SOGoStartupLogger.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef SOGOSTARTUPLOGGER_H
|
||||
#define SOGOSTARTUPLOGGER_H
|
||||
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
@interface SOGoStartupLogger : NSObject
|
||||
|
||||
+ (id) sharedLogger;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* SOGOSTARTUPLOGGER_H */
|
|
@ -0,0 +1,37 @@
|
|||
/* SOGoStartupLogger.m - this file is part of $PROJECT_NAME_HERE$
|
||||
*
|
||||
* Copyright (C) 2009 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
* This file is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This file 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#import "SOGoStartupLogger.h"
|
||||
|
||||
@implementation SOGoStartupLogger
|
||||
|
||||
+ (id) sharedLogger
|
||||
{
|
||||
static id logger = nil;
|
||||
|
||||
if (!logger)
|
||||
logger = [self new];
|
||||
|
||||
return logger;
|
||||
}
|
||||
|
||||
@end
|
14
Main/sogod.m
14
Main/sogod.m
|
@ -32,6 +32,7 @@
|
|||
#if defined(LDAP_CONFIG)
|
||||
#import <SOGo/SOGoLDAPUserDefaults.h>
|
||||
#endif
|
||||
#import "SOGoStartupLogger.h"
|
||||
|
||||
typedef void (*NSUserDefaultsInitFunction) ();
|
||||
|
||||
|
@ -60,6 +61,9 @@ prepareUserDefaults (NSUserDefaults *ud)
|
|||
{
|
||||
NSString *redirectURL;
|
||||
NSDictionary *domain;
|
||||
SOGoStartupLogger *logger;
|
||||
|
||||
logger = [SOGoStartupLogger sharedLogger];
|
||||
|
||||
domain = [ud persistentDomainForName: @"sogod"];
|
||||
if (![domain count])
|
||||
|
@ -67,7 +71,7 @@ prepareUserDefaults (NSUserDefaults *ud)
|
|||
domain = [ud persistentDomainForName: @"sogod-0.9"];
|
||||
if ([domain count])
|
||||
{
|
||||
NSLog (@"migrating user defaults from sogod-0.9");
|
||||
[logger logWithFormat: @"migrating user defaults from sogod-0.9"];
|
||||
[ud setPersistentDomain: domain forName: @"sogod"];
|
||||
[ud removePersistentDomainForName: @"sogod-0.9"];
|
||||
[ud synchronize];
|
||||
|
@ -75,9 +79,17 @@ prepareUserDefaults (NSUserDefaults *ud)
|
|||
}
|
||||
|
||||
redirectURL = [ud stringForKey: @"WOApplicationRedirectURL"];
|
||||
if (redirectURL)
|
||||
{
|
||||
[logger warnWithFormat:
|
||||
@"Using obsolete 'WOApplicationRedirectURL' user default."];
|
||||
[logger warnWithFormat:
|
||||
@" Please configure the use of the x-webobjects-XXX headers"
|
||||
@" with your webserver (see sample files)."];
|
||||
if ([redirectURL hasSuffix: @"/"])
|
||||
[ud setObject: [redirectURL substringToIndex: [redirectURL length] - 1]
|
||||
forKey: @"WOApplicationRedirectURL"];
|
||||
}
|
||||
[ud setBool: YES forKey: @"WOMessageUseUTF8"];
|
||||
[ud setBool: YES forKey: @"WOParsersUseUTF8"];
|
||||
[ud setBool: YES forKey: @"NGUseUTF8AsURLEncoding"];
|
||||
|
|
Loading…
Reference in New Issue