mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-28 16:29:30 +00:00
(fix) XSRF supprot for all contact operations
This commit is contained in:
@@ -632,6 +632,23 @@
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $exportCards
|
||||
* @memberof AddressBook.prototype
|
||||
* @desc Export the selected/all cards
|
||||
* @returns a promise of the HTTP operation
|
||||
*/
|
||||
AddressBook.prototype.exportCards = function(selectedOnly) {
|
||||
var selectedUIDs;
|
||||
|
||||
if (selectedOnly) {
|
||||
var selectedCards = _.filter(this.$cards, function(card) { return card.selected; });
|
||||
selectedUIDs = _.map(selectedCards, 'id');
|
||||
}
|
||||
|
||||
return AddressBook.$$resource.download(this.id, 'export', (angular.isDefined(selectedUIDs) ? {uids: selectedUIDs} : null), {type: 'application/octet-stream'});
|
||||
};
|
||||
|
||||
/**
|
||||
* @function $unwrap
|
||||
* @memberof AddressBook.prototype
|
||||
|
||||
Reference in New Issue
Block a user