feat(core): Add mobile provisioning download for Apple's devices

This commit is contained in:
smizrahi authored and Hivert Quentin committed 2023-09-27 17:28:29 +02:00
1 parent 5b73a60aa6
commit 6d16ee7988
15 files changed
+282 -2

No files matched your search

+27
View File
@@ -35,9 +35,11 @@
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import <SOGo/SOGoUserManager.h>
#import <SOGo/SOGoMobileProvision.h>
#import <Contacts/NGVCard+SOGo.h>
#import <Contacts/SOGoContactObject.h>
#import <Contacts/SOGoContactFolders.h>
#import "UIxContactView.h"
@@ -448,4 +450,29 @@
return [NSString stringWithFormat: @"%@/photo", [soURL absoluteString]];
}
- (WOResponse *) mobileconfigAction
{
SOGoContactFolders *folders;
NSString *davURL, *plistContent, *disposition;
WOResponse *response;
folders = [self clientObject];
davURL = [[folders container] davURLAsString];
plistContent = [SOGoMobileProvision plistForContactsWithContext: context andPath: davURL];
if (nil != plistContent) {
response = [self responseWithStatus: 200
andString: plistContent];
[response setHeader: @"application/x-plist; charset=utf-8"
forKey: @"content-type"];
disposition = [NSString stringWithString: @"attachment; filename=\"contacts.mobileconfig\""];
[response setHeader: disposition forKey: @"Content-Disposition"];
} else {
response = [self responseWithStatus: 500
andString: @"Error while generating profile"];
}
return response;
}
@end /* UIxContactView */