mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-07 09:25:09 +00:00
Monotone-Parent: e7a3d03032fdca1b9564002f83fa7c9947b6cb17
Monotone-Revision: 2d2d3a51a60fe527ccb060a620cf04792ccfb293 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-18T19:13:26
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
2012-04-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolders.m
|
||||
(-newWebCalendarWithName:atURL:): perform sanity checks on the url
|
||||
parameter.
|
||||
|
||||
* SoObjects/Appointments/SOGoWebAppointmentFolder.m
|
||||
(-setUsername:andPassword:): new method that associate an
|
||||
encrypted login pair for authenticating to remove calendars.
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSEnumerator.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import <Foundation/NSURL.h>
|
||||
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WORequest+So.h>
|
||||
@@ -133,25 +134,35 @@ static SoSecurityManager *sm = nil;
|
||||
|
||||
- (SOGoWebAppointmentFolder *)
|
||||
newWebCalendarWithName: (NSString *) folderDisplayName
|
||||
atURL: (NSString *) url
|
||||
atURL: (NSString *) urlString
|
||||
{
|
||||
NSException *error;
|
||||
SOGoAppointmentFolder *aptFolder;
|
||||
SOGoWebAppointmentFolder *webCalendar;
|
||||
NSString *name;
|
||||
NSURL *url;
|
||||
|
||||
if ([self newFolderWithName: folderDisplayName
|
||||
nameInContainer: &name])
|
||||
webCalendar = nil;
|
||||
else
|
||||
webCalendar = nil;
|
||||
|
||||
if ([folderDisplayName length] > 0 && [urlString length] > 0)
|
||||
{
|
||||
aptFolder = [subFolders objectForKey: name];
|
||||
[aptFolder setFolderPropertyValue: url
|
||||
inCategory: @"WebCalendars"];
|
||||
|
||||
webCalendar = [SOGoWebAppointmentFolder objectWithName: name
|
||||
inContainer: self];
|
||||
[webCalendar setOCSPath: [aptFolder ocsPath]];
|
||||
[subFolders setObject: webCalendar forKey: name];
|
||||
url = [NSURL URLWithString: urlString];
|
||||
if ([[url scheme] hasPrefix: @"http"])
|
||||
{
|
||||
error = [self newFolderWithName: folderDisplayName
|
||||
nameInContainer: &name];
|
||||
if (!error)
|
||||
{
|
||||
aptFolder = [subFolders objectForKey: name];
|
||||
[aptFolder setFolderPropertyValue: urlString
|
||||
inCategory: @"WebCalendars"];
|
||||
|
||||
webCalendar = [SOGoWebAppointmentFolder objectWithName: name
|
||||
inContainer: self];
|
||||
[webCalendar setOCSPath: [aptFolder ocsPath]];
|
||||
[subFolders setObject: webCalendar forKey: name];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return webCalendar;
|
||||
@@ -542,6 +553,7 @@ static SoSecurityManager *sm = nil;
|
||||
calSettings = [us objectForKey: @"Calendar"];
|
||||
refs = [[calSettings objectForKey: @"WebCalendars"] allKeys];
|
||||
max = [refs count];
|
||||
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
ref = [refs objectAtIndex: count];
|
||||
|
||||
Reference in New Issue
Block a user