blob: 27739a0ccd881e561f6b4f3be30243275ec6c18d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
(function () {
angular.module('piwikApp').controller('AnonymizeIpController', AnonymizeIpController);
AnonymizeIpController.$inject = ['piwikApi'];
function AnonymizeIpController(piwikApi) {
// remember to keep controller very simple. Create a service/factory (model) if needed
var self = this;
this.isLoading = false;
this.save = function () {
this.isLoading = true;
piwikApi.post({module: 'API', method: 'PrivacyManager.setAnonymizeIpSettings'}, {
anonymizeIPEnable: this.enabled ? '1' : '0',
anonymizeUserId: this.anonymizeUserId ? '1' : '0',
anonymizeOrderId: this.anonymizeOrderId ? '1' : '0',
anonymizeReferrer: this.anonymizeReferrer ? this.anonymizeReferrer : '',
maskLength: this.maskLength,
useAnonymizedIpForVisitEnrichment: parseInt(this.useAnonymizedIpForVisitEnrichment, 10) ? '1' : '0'
}).then(function (success) {
self.isLoading = false;
var UI = require('piwik/UI');
var notification = new UI.Notification();
notification.show(_pk_translate('CoreAdminHome_SettingsSaveSuccess'), {context: 'success', id:'privacyManagerSettings'});
notification.scrollToNotification();
}, function () {
self.isLoading = false;
});
};
}
})();
|