mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-07 12:57:14 +00:00
feat(core): Add mobile provisioning download for Apple's devices
This commit is contained in:
1 parent
5b73a60aa6
commit
6d16ee7988
15 files changed
+282
-2
No files matched your search
@@ -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 */
|
||||
Reference in new issue
Block a user