mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 13:43:22 +00:00
feat(core): Add URL encryption for GDPR compliancy. Remove dav encryption
This commit is contained in:
@@ -365,7 +365,7 @@
|
||||
NSString *usersUrl;
|
||||
|
||||
usersUrl = [NSString stringWithFormat: @"%@%@/",
|
||||
[[WOApplication application] davURLAsString], [SOGoUser getEncryptedUsernameIfNeeded: owner withContext: context]];
|
||||
[[WOApplication application] davURLAsString], owner];
|
||||
ownerHREF = davElementWithContent (@"href", XMLNS_WEBDAV, usersUrl);
|
||||
|
||||
return [davElementWithContent (@"owner", XMLNS_WEBDAV, ownerHREF)
|
||||
@@ -946,6 +946,7 @@
|
||||
NSMutableArray *path;
|
||||
NSString *baseURL, *urlMethod, *fullHost;
|
||||
NSNumber *port;
|
||||
int i;
|
||||
|
||||
serverURL = [context serverURL];
|
||||
baseURL = [[self baseURLInContext: context] stringByUnescapingURL];
|
||||
@@ -973,6 +974,17 @@
|
||||
else
|
||||
fullHost = [serverURL host];
|
||||
|
||||
for (i = 0 ; i < [path count] ; i++) {
|
||||
// For DAV url, the username must be decrypted
|
||||
// Username is placed afted dav in url components
|
||||
if ([[[path objectAtIndex: i] lowercaseString] isEqualToString:@"dav"]) {
|
||||
if ([path count] > (i + 1)) {
|
||||
[path replaceObjectAtIndex: (i +1)
|
||||
withObject: [SOGoUser getDecryptedUsernameIfNeeded: [path objectAtIndex: (i + 1)]]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
url = [[NSURL alloc] initWithScheme: [serverURL scheme]
|
||||
host: fullHost
|
||||
path: [path componentsJoinedByString: @"/"]];
|
||||
@@ -1227,7 +1239,7 @@
|
||||
davCurrentUserPrincipal = nil;
|
||||
else
|
||||
{
|
||||
s = [NSString stringWithFormat: @"/SOGo/dav/%@", [SOGoUser getEncryptedUsernameIfNeeded:login withContext:[self context]]];
|
||||
s = [NSString stringWithFormat: @"/SOGo/dav/%@", login];
|
||||
userHREF = davElementWithContent (@"href", XMLNS_WEBDAV, s);
|
||||
davCurrentUserPrincipal
|
||||
= [davElementWithContent (@"current-user-principal",
|
||||
|
||||
Reference in New Issue
Block a user