Monotone-Parent: 50245e5ff224a38e104b57dccfa0384915476341

Monotone-Revision: dba126da77bea65fd37325e4be553aaddcd108d1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-03-27T18:15:51
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-03-27 18:15:51 +00:00
parent 0bcd0f561a
commit 577be1b049
3 changed files with 38 additions and 23 deletions
+8
View File
@@ -1,5 +1,13 @@
2007-03-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/AgenorUserManager.m ([AgenorUserManager
-getUserDefaultsForUID:uid]): rewrote method to use the "defaults"
field of the sogo_user_profile table, where the user-customizable
changes will be saved.
([AgenorUserManager -getUserSettingsForUID:uid]): new method
similar to the one above, using the "settings" field where the
automatic settings will be saved.
* SoObjects/SOGo/AgenorUserDefaults.m: rewrote a big part of the
module to bind the userdefaults to a property list contained in a
specified field of the sogo_user_profile table.
+2 -1
View File
@@ -75,7 +75,8 @@
- (NSURL *)getFreeBusyURLForUID:(NSString *)_uid;
- (NSUserDefaults *)getUserDefaultsForUID:(NSString *)_uid;
- (NSUserDefaults *) getUserDefaultsForUID: (NSString *) uid;
- (NSUserDefaults *) getUserSettingsForUID: (NSString *) uid;
- (BOOL)isUserAllowedToChangeSOGoInternetAccess:(NSString *)_uid;
+28 -22
View File
@@ -1012,22 +1012,39 @@ static unsigned PoolScanInterval = 5 * 60 /* every five minutes */;
/* defaults */
- (NSUserDefaults *)getUserDefaultsForUID:(NSString *)_uid {
- (NSUserDefaults *) _getUserDefaultsForUID: (NSString *) uid
fieldName: (NSString *) fieldName
{
id defaults;
if (AgenorProfileURL == nil) {
[self warnWithFormat:
@"no profile configured, cannot retrieve defaults for user: '%@'",
_uid];
return nil;
}
/* Note: do not cache, otherwise updates can be quite tricky */
defaults = [[[AgenorUserDefaults alloc]
initWithTableURL:AgenorProfileURL uid:_uid] autorelease];
if (AgenorProfileURL)
{
/* Note: do not cache, otherwise updates can be quite tricky */
defaults = [[AgenorUserDefaults alloc] initWithTableURL: AgenorProfileURL
uid: uid fieldName: fieldName];
[defaults autorelease];
}
else
{
[self warnWithFormat:
@"no profile configured, cannot retrieve defaults for user: '%@'",
uid];
return defaults = nil;
}
return defaults;
}
- (NSUserDefaults *) getUserDefaultsForUID: (NSString *) uid
{
return [self _getUserDefaultsForUID: uid fieldName: @"defaults"];
}
- (NSUserDefaults *) getUserSettingsForUID: (NSString *) uid
{
return [self _getUserDefaultsForUID: uid fieldName: @"settings"];
}
/* internet access lock */
- (BOOL)isUserAllowedToChangeSOGoInternetAccess:(NSString *)_uid {
@@ -1194,15 +1211,4 @@ static unsigned PoolScanInterval = 5 * 60 /* every five minutes */;
return debugOn;
}
/* description */
- (NSString *)description {
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:16];
[ms appendFormat:@"<0x%08X[%@]", self, NSStringFromClass([self class])];
[ms appendString:@">"];
return ms;
}
@end /* AgenorUserManager */