From 95efe73e69abaae7fb8c1bdd0fe7ac660d59d7a4 Mon Sep 17 00:00:00 2001 From: Hivert Quentin Date: Mon, 22 Dec 2025 17:28:49 +0100 Subject: [PATCH] fix(encryptedUrl): fix cache key data and expect uncrypted name for freebusy --- SoObjects/SOGo/SOGoCache.m | 2 +- SoObjects/SOGo/SOGoUser.m | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/SoObjects/SOGo/SOGoCache.m b/SoObjects/SOGo/SOGoCache.m index f207d4db8..01e6790ab 100644 --- a/SoObjects/SOGo/SOGoCache.m +++ b/SoObjects/SOGo/SOGoCache.m @@ -289,7 +289,7 @@ static memcached_st *handle = NULL; NSData *keyData, *valueData; memcached_return error; - // [self logWithFormat: @"setValue: '%@' forKey: '%@'", value, key]; + //[self logWithFormat: @"setValue: '%@' forKey: '%@'", value, key]; if (handle) { keyData = [key dataUsingEncoding: NSUTF8StringEncoding]; diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 9df14f3af..675b88aa8 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -47,7 +47,6 @@ #import "SOGoUser.h" -static const NSString *kEncryptedUserNamePrefix = @"uenc"; @implementation SoUser (SOGoExtension) @@ -1371,7 +1370,7 @@ static const NSString *kEncryptedUserNamePrefix = @"uenc"; return username; cache = [SOGoCache sharedCache]; - cacheKey = [NSString stringWithFormat: @"%@_%@", kEncryptedUserNamePrefix, username]; + cacheKey = [NSString stringWithFormat: @"encrypted_%@",username]; exception = nil; tmp = nil; @@ -1402,11 +1401,14 @@ static const NSString *kEncryptedUserNamePrefix = @"uenc"; NSString *tmp, *cacheKey; SOGoCache *cache; - if (![[SOGoSystemDefaults sharedSystemDefaults] isURLEncryptionEnabled] || [username isEqualToString: @"anonymous"] || [[request requestHandlerKey] isEqualToString:@"dav"]) + if (![[SOGoSystemDefaults sharedSystemDefaults] isURLEncryptionEnabled] || + [username isEqualToString: @"anonymous"] || + [[request requestHandlerKey] isEqualToString:@"dav"] || + [[request requestHandlerPath] hasSuffix: @"freebusy.ifb/ajaxRead"]) return username; cache = [SOGoCache sharedCache]; - cacheKey = [NSString stringWithFormat: @"%@_%@", kEncryptedUserNamePrefix, username]; + cacheKey = [NSString stringWithFormat: @"decrypted_%@", username]; exception = nil; tmp = nil;