See ChangeLog

Monotone-Parent: 9b0e70cef01c0afdbc1684211507c86871122671
Monotone-Revision: 62fdfc357dc0083e5a5dfdb61396923e593cac82

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2011-04-28T13:36:29
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2011-04-28 13:36:29 +00:00
parent 0da18c4bf2
commit 8f81f2b0db
6 changed files with 49 additions and 3 deletions
+8
View File
@@ -1,3 +1,11 @@
2011-04-28 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/SOGo/SQLSource.{h,m}: Added resources support,
just like for LDAP-based sources.
* SoObjects/SOGo/SOGoParentFolder.m (_createPersonalFolder):
We now also autocreate database tables if the "user"
is a resource.
2011-04-25 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/SchedulerUI.js (onFolderUnsubscribeCB):
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
/* SOGoFolder.m - this file is part of SOGo
*
* Copyright (C) 2007-2009 Inverse inc.
* Copyright (C) 2007-2011 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
+6 -1
View File
@@ -159,7 +159,12 @@ static SoSecurityManager *sm = nil;
SOGoGCSFolder *folder;
roles = [[context activeUser] rolesForObject: self inContext: context];
if ([roles containsObject: SoRole_Owner])
// We autocreate the calendars if the user is the owner, a superuser or
// if it's a resource as we won't necessarily want to login as a resource
// in order to create its database tables.
if ([roles containsObject: SoRole_Owner] ||
[[context activeUser] isResource])
{
folder = [subFolderClass objectWithName: @"personal" inContainer: self];
[folder setDisplayName: [self defaultFolderName]];
+4
View File
@@ -42,6 +42,10 @@
NSString *_imapLoginField;
NSString *_userPasswordAlgorithm;
NSURL *_viewURL;
/* resources handling */
NSString *_kindField;
NSString *_multipleBookingsField;
}
@end
+30 -1
View File
@@ -83,6 +83,8 @@
_mailFields = nil;
_userPasswordAlgorithm = nil;
_viewURL = nil;
_kindField = nil;
_multipleBookingsField = nil;
}
return self;
@@ -95,6 +97,8 @@
[_mailFields release];
[_userPasswordAlgorithm release];
[_viewURL release];
[_kindField release];
[_multipleBookingsField release];
[super dealloc];
}
@@ -109,7 +113,9 @@
ASSIGN(_mailFields, [udSource objectForKey: @"MailFieldNames"]);
ASSIGN(_userPasswordAlgorithm, [udSource objectForKey: @"userPasswordAlgorithm"]);
ASSIGN(_imapLoginField, [udSource objectForKey: @"IMAPLoginFieldName"]);
ASSIGN(_kindField, [udSource objectForKey: @"KindFieldName"]);
ASSIGN(_multipleBookingsField, [udSource objectForKey: @"MultipleBookingsFieldName"]);
if (!_userPasswordAlgorithm)
_userPasswordAlgorithm = @"none";
@@ -462,6 +468,29 @@
[response setObject: [response objectForKey: _imapLoginField] forKey: @"c_imaplogin"];
}
// We check if it's a resource of not
if (_kindField)
{
if ((value = [response objectForKey: _kindField]))
{
if ([value caseInsensitiveCompare: @"location"] == NSOrderedSame ||
[value caseInsensitiveCompare: @"thing"] == NSOrderedSame ||
[value caseInsensitiveCompare: @"group"] == NSOrderedSame)
{
[response setObject: [NSNumber numberWithInt: 1]
forKey: @"isResource"];
}
}
}
if (_multipleBookingsField)
{
if ((value = [response objectForKey: _multipleBookingsField]))
{
[response setObject: [NSNumber numberWithInt: [value intValue]]
forKey: @"numberOfSimultaneousBookings"];
}
}
}
else
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];