Merge branch 'master' into feature-gdpr

This commit is contained in:
smizrahi
2023-10-18 13:29:29 +02:00
14 changed files with 88 additions and 53 deletions
@@ -756,14 +756,25 @@
* @returns a promise of the HTTP operation
*/
AddressBook.prototype.downloadProvisioningProfile = function () {
var options;
var options, resource, index, ownerPaths, realOwnerId, path;
options = {
type: 'application/octet-stream',
filename: 'addressbook.mobileconfig'
}
return AddressBook.$$resource.open('', 'mobileconfig', null, options);
if (this.isSubscription) {
index = this.urls.cardDavURL.indexOf('/dav/');
ownerPaths = this.urls.cardDavURL.substring(index + 5).split(/\//);
realOwnerId = ownerPaths[0];
resource = AddressBook.$$resource.userResource(realOwnerId);
path = ownerPaths[1] + '/' + ownerPaths[2];
} else {
resource = AddressBook.$$resource;
path = this.id;
}
return resource.open(path, 'mobileconfig', null, options);
};
/**
@@ -583,14 +583,25 @@
* @returns a promise of the HTTP operation
*/
Calendar.prototype.downloadProvisioningProfile = function () {
var options;
var options, resource, index, ownerPaths, realOwnerId, path;
options = {
type: 'application/octet-stream',
filename: 'calendar.mobileconfig'
}
return Calendar.$$resource.open('', 'mobileconfig', null, options);
if (this.isSubscription) {
index = this.urls.webDavICSURL.indexOf('/dav/');
ownerPaths = this.urls.webDavICSURL.substring(index + 5).split(/\//);
realOwnerId = ownerPaths[0];
resource = Calendar.$$resource.userResource(realOwnerId);
path = 'Calendar';
} else {
resource = Calendar.$$resource;
path = '';
}
return resource.open(path, 'mobileconfig', null, options);
};
/**