pull/210/head
parent
604705960e
commit
875a4aca32
|
@ -41,12 +41,14 @@
|
|||
#import <SOGo/NSDictionary+Utilities.h>
|
||||
#import <SOGo/NSObject+DAV.h>
|
||||
#import <SOGo/NSObject+Utilities.h>
|
||||
#import <SOGo/NSString+Crypto.h>
|
||||
#import <SOGo/NSString+Utilities.h>
|
||||
#import <SOGo/SOGoBuild.h>
|
||||
#import <SOGo/SOGoMailer.h>
|
||||
#import <SOGo/SOGoGroup.h>
|
||||
#import <SOGo/SOGoPermissions.h>
|
||||
#import <SOGo/SOGoUser.h>
|
||||
#import <SOGo/SOGoUserSettings.h>
|
||||
#import <SOGo/SOGoSystemDefaults.h>
|
||||
#import <SOGo/SOGoUserManager.h>
|
||||
#import <SOGo/SOGoWebDAVAclManager.h>
|
||||
|
@ -202,14 +204,21 @@
|
|||
|
||||
- (void) _filterComponent: (iCalEntityObject *) component
|
||||
{
|
||||
NSString *type, *summary, *tag;
|
||||
NSArray *children;
|
||||
NSString *type, *summary, *tag, *uid;
|
||||
SOGoUserSettings *settings;
|
||||
SOGoUser *calendarOwner;
|
||||
NSEnumerator *children;
|
||||
CardElement *element;
|
||||
NSArray *tags;
|
||||
|
||||
int classification, i;
|
||||
int classification;
|
||||
|
||||
type = @"vtodo";
|
||||
classification = 0;
|
||||
|
||||
calendarOwner = [SOGoUser userWithLogin: [self ownerInContext: context]];
|
||||
settings = [calendarOwner userSettings];
|
||||
|
||||
if ([component isKindOfClass: [iCalEvent class]])
|
||||
type = @"vevent";
|
||||
|
||||
|
@ -221,25 +230,23 @@
|
|||
summary = [self labelForKey: [NSString stringWithFormat: @"%@_class%d",
|
||||
type, classification]
|
||||
inContext: context];
|
||||
[component setSummary: summary];
|
||||
[component setComment: @""];
|
||||
[component setUserComment: @""];
|
||||
[component setLocation: @""];
|
||||
[component setCategories: [NSArray array]];
|
||||
[component setUrl: @""];
|
||||
[component setOrganizer: nil];
|
||||
[component removeAllAttendees];
|
||||
[component removeAllAlarms];
|
||||
|
||||
// We strip all X- tags
|
||||
children = [component children];
|
||||
tags = [NSArray arrayWithObjects: @"DTSTAMP", @"DTSTART", @"DTEND", @"DUE", @"EXDATE", @"EXRULE", @"RRULE", nil];
|
||||
uid = [[component uid] asCryptedPassUsingScheme: @"ssha256"
|
||||
withSalt: [[settings userSalt] dataUsingEncoding: NSASCIIStringEncoding]
|
||||
andEncoding: encHex];
|
||||
|
||||
for (i = 0; i < [children count]; i++)
|
||||
children = [[[[component children] copy] autorelease] objectEnumerator];
|
||||
|
||||
while ((element = [children nextObject]))
|
||||
{
|
||||
tag = [[children objectAtIndex: i] tag];
|
||||
if ([[tag uppercaseString] hasPrefix: @"X-"])
|
||||
[component removeChild: [children objectAtIndex: i]];
|
||||
tag = [element tag];
|
||||
if (![tags containsObject: [tag uppercaseString]])
|
||||
[component removeChild: element];
|
||||
}
|
||||
|
||||
[component setSummary: summary];
|
||||
[component setUid: uid];
|
||||
}
|
||||
|
||||
- (NSString *) secureContentAsString
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoUserSettings.h - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2014 Inverse inc.
|
||||
* Copyright (C) 2009-2016 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
|
||||
|
@ -33,6 +33,7 @@
|
|||
|
||||
- (NSArray *) subscribedCalendars;
|
||||
- (NSArray *) subscribedAddressBooks;
|
||||
- (NSString *) userSalt;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* SOGoUserSettings.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2009-2014 Inverse inc.
|
||||
* Copyright (C) 2009-2016 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
|
||||
|
@ -19,9 +19,11 @@
|
|||
*/
|
||||
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSProcessInfo.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import "SOGoUserProfile.h"
|
||||
#import "NSString+Crypto.h"
|
||||
|
||||
#import "SOGoUserSettings.h"
|
||||
|
||||
|
@ -68,4 +70,28 @@ static Class SOGoUserProfileKlass = Nil;
|
|||
return [self _subscribedFoldersForModule: @"Contacts"];
|
||||
}
|
||||
|
||||
- (NSString *) userSalt
|
||||
{
|
||||
NSMutableDictionary *values;
|
||||
NSString *salt;
|
||||
|
||||
salt = [[self dictionaryForKey: @"General"] objectForKey: @"Salt"];
|
||||
|
||||
if (!salt)
|
||||
{
|
||||
salt = [[[NSProcessInfo processInfo] globallyUniqueString] asSHA1String];
|
||||
values = [self objectForKey: @"General"];
|
||||
|
||||
if (!values)
|
||||
values = [NSMutableDictionary dictionary];
|
||||
|
||||
[values setObject: salt forKey: @"Salt"];
|
||||
[self setObject: values forKey: @"General"];
|
||||
[self synchronize];
|
||||
}
|
||||
|
||||
return salt;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in New Issue