Preferences saving support

This commit is contained in:
Ludovic Marcotte
2015-06-12 11:27:17 -04:00
committed by Francis Lachapelle
parent 2edfd1863b
commit 96d2a4cea8
6 changed files with 34 additions and 24 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
/* UIxPreferences.h - this file is part of SOGo
*
* Copyright (C) 2007-2013 Inverse inc.
* Copyright (C) 2007-2015 Inverse inc.
*
* 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
@@ -61,7 +61,7 @@
}
- (NSString *) userLongDateFormat;
//- (NSString *) userLongDateFormat;
- (BOOL) isSieveServerAvailable;
- (id) sieveClient;
+18 -9
View File
@@ -58,14 +58,6 @@
#import "UIxPreferences.h"
#warning this class is not finished
/* remaining:
default event length
default snooze length
refresh calendar every X minutes
workweek = from -> to
identities */
static NSArray *reminderItems = nil;
static NSArray *reminderValues = nil;
@@ -1889,7 +1881,24 @@ static NSArray *reminderValues = nil;
- (id <WOActionResults>) saveAction
{
//return [self responseWithStatus: 200 andJSONRepresentation: data];
SOGoUser *user;
id o, v;
o = [[[context request] contentAsString] objectFromJSONString];
user = [[self context] activeUser];
if ((v = [o objectForKey: @"defaults"]))
{
[[[user userDefaults] source] setValues: v];
[[user userDefaults] synchronize];
}
if ((v = [o objectForKey: @"settings"]))
{
[[[user userSettings] source] setValues: v];
[[user userSettings] synchronize];
}
return [self responseWithStatus: 200];
}