mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 08:34:30 +00:00
Monotone-Parent: 2fdf0ead0781ef2362dd389811d5db44ca4cc84a
Monotone-Revision: c91eef7edcfd08d414664c25a590b6268a7e58e2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-29T04:19:32 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
+18
-27
@@ -20,7 +20,6 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
|
||||
#import <NGObjWeb/WOApplication.h>
|
||||
#import <NGObjWeb/WOContext.h>
|
||||
@@ -33,13 +32,13 @@
|
||||
#import <NGExtensions/NSString+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
|
||||
#import <SoObjects/SOGo/SOGoWebAuthenticator.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoDomainDefaults.h>
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoWebAuthenticator.h>
|
||||
|
||||
#import "SOGoRootPage.h"
|
||||
|
||||
static NSArray *supportedLanguages = nil;
|
||||
|
||||
@interface SOGoRootPage (crashAdditions)
|
||||
|
||||
- (void) segfault;
|
||||
@@ -48,12 +47,6 @@ static NSArray *supportedLanguages = nil;
|
||||
|
||||
@implementation SOGoRootPage
|
||||
|
||||
+ (void) initialize
|
||||
{
|
||||
if (!supportedLanguages)
|
||||
supportedLanguages = [NSArray arrayWithObjects: @"Czech", @"Welsh", @"English", @"Spanish", @"French", @"German", @"Italian", @"Hungarian", @"Dutch", @"BrazilianPortuguese", @"Russian", @"Swedish", nil];
|
||||
}
|
||||
|
||||
/* accessors */
|
||||
|
||||
- (NSString *) connectURL
|
||||
@@ -68,9 +61,10 @@ static NSArray *supportedLanguages = nil;
|
||||
WORequest *request;
|
||||
WOCookie *authCookie;
|
||||
SOGoWebAuthenticator *auth;
|
||||
SOGoUser *user;
|
||||
SOGoUserDefaults *ud;
|
||||
NSString *cookieValue, *cookieString;
|
||||
NSString *userName, *password, *language;
|
||||
NSArray *supportedLanguages;
|
||||
|
||||
auth = [[WOApplication application]
|
||||
authenticatorInContext: context];
|
||||
@@ -93,12 +87,14 @@ static NSArray *supportedLanguages = nil;
|
||||
[authCookie setIsSecure: YES]; */
|
||||
[response addCookie: authCookie];
|
||||
|
||||
supportedLanguages = [[SOGoSystemDefaults sharedSystemDefaults]
|
||||
supportedLanguages];
|
||||
if (language && [supportedLanguages containsObject: language])
|
||||
{
|
||||
user = [SOGoUser userWithLogin: userName roles: nil];
|
||||
[[user userDefaults] setObject: language forKey: @"Language"];
|
||||
[[user userDefaults] synchronize];
|
||||
[user invalidateLanguage];
|
||||
ud = [[SOGoUser userWithLogin: userName roles: nil]
|
||||
userDefaults];
|
||||
[ud setLanguage: language];
|
||||
[ud synchronize];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -160,11 +156,7 @@ static NSArray *supportedLanguages = nil;
|
||||
|
||||
- (NSString *) loginSuffix
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
return [ud stringForKey: @"SOGoLoginSuffix"];
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] loginSuffix];
|
||||
}
|
||||
|
||||
- (BOOL) hasLoginSuffix
|
||||
@@ -184,13 +176,13 @@ static NSArray *supportedLanguages = nil;
|
||||
|
||||
- (NSArray *) languages
|
||||
{
|
||||
return supportedLanguages;
|
||||
return [[SOGoSystemDefaults sharedSystemDefaults] supportedLanguages];
|
||||
}
|
||||
|
||||
- (NSString *) language
|
||||
{
|
||||
return [SOGoUser language];
|
||||
}
|
||||
// - (NSString *) language
|
||||
// {
|
||||
// return [SOGoUser language];
|
||||
// }
|
||||
|
||||
- (NSString *) languageText
|
||||
{
|
||||
@@ -213,5 +205,4 @@ static NSArray *supportedLanguages = nil;
|
||||
return aString;
|
||||
}
|
||||
|
||||
|
||||
@end /* SOGoRootPage */
|
||||
|
||||
Reference in New Issue
Block a user