mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-21 23:12:40 +00:00
See ChangeLog
Monotone-Parent: f4d1aaac3bdf07ab4ee67974f65577c30c1bb0fe Monotone-Revision: ec9c129ca2ad9336942f829750ea17901e60315b Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2007-10-14T16:07:22 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
cb0d2b7051
commit
7d182c760f
13 files changed
+475
-6
No files matched your search
@@ -31,6 +31,7 @@
|
||||
#import <NGObjWeb/SoObject+SoDAV.h>
|
||||
#import <NGObjWeb/SoSelectorInvocation.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WOApplication.h>
|
||||
#import <NGExtensions/NSNull+misc.h>
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <EOControl/EOQualifier.h>
|
||||
@@ -41,6 +42,7 @@
|
||||
#import <GDLContentStore/GCSFolderType.h>
|
||||
#import <GDLContentStore/NSURL+GCS.h>
|
||||
#import <SaxObjC/XMLNamespaces.h>
|
||||
#import <UI/SOGoUI/SOGoFolderAdvisory.h>
|
||||
|
||||
#import "NSArray+Utilities.h"
|
||||
#import "NSString+Utilities.h"
|
||||
@@ -255,15 +257,35 @@ static NSString *defaultUserID = @"<default>";
|
||||
return @"";
|
||||
}
|
||||
|
||||
- (void) sendFolderAdvisoryTemplate: (NSString *) template
|
||||
{
|
||||
NSString *language, *pageName;
|
||||
SOGoUser *user;
|
||||
SOGoFolderAdvisory *page;
|
||||
WOApplication *app;
|
||||
|
||||
user = [SOGoUser userWithLogin: [[context activeUser] login] roles: nil];
|
||||
language = [user language];
|
||||
pageName = [NSString stringWithFormat: @"SOGoFolder%@%@Advisory",
|
||||
language, template];
|
||||
|
||||
app = [WOApplication application];
|
||||
page = [app pageWithName: pageName inContext: context];
|
||||
[page setFolderObject: self];
|
||||
[page setRecipientUID: [[context activeUser] login]];
|
||||
[page send];
|
||||
}
|
||||
|
||||
- (BOOL) create
|
||||
{
|
||||
NSException *result;
|
||||
|
||||
// [self dieHard];
|
||||
result = [[self folderManager] createFolderOfType: [self folderType]
|
||||
withName: displayName
|
||||
atPath: ocsPath];
|
||||
|
||||
if (!result) [self sendFolderAdvisoryTemplate: @"Addition"];
|
||||
|
||||
return (result == nil);
|
||||
}
|
||||
|
||||
@@ -271,12 +293,17 @@ static NSString *defaultUserID = @"<default>";
|
||||
{
|
||||
NSException *error;
|
||||
|
||||
// We just fetch our displayName since our table will use it!
|
||||
[self displayName];
|
||||
|
||||
if ([nameInContainer isEqualToString: @"personal"])
|
||||
error = [NSException exceptionWithHTTPStatus: 403
|
||||
reason: @"folder 'personal' cannot be deleted"];
|
||||
else
|
||||
error = [[self folderManager] deleteFolderAtPath: ocsPath];
|
||||
|
||||
if (!error) [self sendFolderAdvisoryTemplate: @"Removal"];
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user