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

This commit is contained in:
smizrahi
2023-09-27 17:28:29 +02:00
committed by Hivert Quentin
parent 5b73a60aa6
commit 6d16ee7988
15 changed files with 282 additions and 2 deletions
+26
View File
@@ -36,6 +36,7 @@
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h>
#import <SOGo/SOGoUserSettings.h>
#import <SOGo/SOGoMobileProvision.h>
#import <SOGoUI/SOGoAptFormatter.h>
@@ -657,4 +658,29 @@
return r;
}
- (WOResponse *) mobileconfigAction
{
SOGoAppointmentFolders *folders;
NSString *davURL, *plistContent, *disposition;
WOResponse *response;
folders = [self clientObject];
davURL = [[folders container] davURLAsString];
plistContent = [SOGoMobileProvision plistForCalendarsWithContext: 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=\"calendar.mobileconfig\""];
[response setHeader: disposition forKey: @"Content-Disposition"];
} else {
response = [self responseWithStatus: 500
andString: @"Error while generating profile"];
}
return response;
}
@end /* UIxCalView */