From f460a45cce77ad272c37e466f8ea6d8e442a8439 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 30 Aug 2018 16:43:08 -0400 Subject: #692 zoneminder privacy warning --- www/js/DataModel.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'www/js/DataModel.js') 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; + }, + //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- -- cgit v1.2.3