summaryrefslogtreecommitdiff
path: root/www/js/DataModel.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-08-30 16:43:08 -0400
committerPliable Pixels <pliablepixels@gmail.com>2018-08-30 16:43:08 -0400
commitf460a45cce77ad272c37e466f8ea6d8e442a8439 (patch)
tree6d2972adea51c7bfd0566bf87bb806019c3fd64f /www/js/DataModel.js
parentd0884f83a6fa0efe22cb14f31b722c5e16cea81c (diff)
#692 zoneminder privacy warning
Diffstat (limited to 'www/js/DataModel.js')
-rwxr-xr-xwww/js/DataModel.js53
1 files changed, 53 insertions, 0 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 26c3cd3b..848824d5 100755
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -293,6 +293,7 @@ angular.module('zmApp.controllers')
}
}
+
function getZmsMultiPortSupport(forceReload) {
var d = $q.defer();
@@ -2162,6 +2163,58 @@ angular.module('zmApp.controllers')
},
+ zmPrivacyProcessed: function() {
+ var apiurl = loginData.apiurl;
+ var myurl = apiurl + '/configs/viewByName/ZM_SHOW_PRIVACY.json';
+ var d = $q.defer();
+
+ $http({
+ url: myurl,
+ method: 'GET',
+ transformResponse: undefined
+ })
+ // $http.get(myurl)
+ .then (function (textsucc) {
+
+ var succ;
+ try {
+ console.log (textsucc);
+ succ = JSON.parse(textsucc.data);
+ if (succ.data) succ = succ.data;
+ if (succ.config) {
+ if (succ.config.Value=='1') {
+ debug ("Real value of PRIVACY is:"+succ.config.Value);
+ d.resolve(false);
+ }
+ else {
+ debug ("Real value of PRIVACY is:"+succ.config.Value);
+ d.resolve(true);
+ }
+ return d.promise;
+ }
+ else {
+ debug ("ZM_SHOW_PRIVACY likely does not exist");
+ d.resolve(true);
+ return d.promise;
+ }
+
+ }
+ catch (e) {
+ debug ("ZM_SHOW_PRIVACY parsing error, assuming it doesn't exist");
+ d.resolve(true);
+ return d.promise;
+ }
+
+ },
+ function (err) {
+ debug ("ZM_SHOW_PRIVACY returned an error, it likely doesn't exist");
+ d.resolve(true);
+ return d.promise;
+
+ });
+ return d.promise;
+ },
+
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------