diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-08-30 16:43:08 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-08-30 16:43:08 -0400 |
| commit | f460a45cce77ad272c37e466f8ea6d8e442a8439 (patch) | |
| tree | 6d2972adea51c7bfd0566bf87bb806019c3fd64f /www | |
| parent | d0884f83a6fa0efe22cb14f31b722c5e16cea81c (diff) | |
#692 zoneminder privacy warning
Diffstat (limited to 'www')
| -rwxr-xr-x | www/js/DataModel.js | 53 | ||||
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 16 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 3 |
3 files changed, 70 insertions, 2 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; + }, + //----------------------------------------------------------------------------- // //----------------------------------------------------------------------------- diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index c142c536..2397adef 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -3,7 +3,7 @@ /*This is for the loop closure I am using in line 143 */ /* jslint browser: true*/ /* global vis,cordova,StatusBar,angular,console,moment */ -angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionicPlatform', '$scope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$q', '$state', '$ionicLoading', '$ionicPopover', '$ionicScrollDelegate', '$ionicModal', '$timeout', 'zmAutoLogin', '$ionicHistory', 'EventServer', '$translate', function ($ionicPlatform, $scope, zm, NVRDataModel, $ionicSideMenuDelegate, $rootScope, $http, $q, $state, $ionicLoading, $ionicPopover, $ionicScrollDelegate, $ionicModal, $timeout, zmAutoLogin, $ionicHistory, EventServer, $translate) { +angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionicPlatform', '$scope', 'zm', 'NVRDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$q', '$state', '$ionicLoading', '$ionicPopover', '$ionicScrollDelegate', '$ionicModal', '$timeout', 'zmAutoLogin', '$ionicHistory', 'EventServer', '$translate', '$ionicPopup',function ($ionicPlatform, $scope, zm, NVRDataModel, $ionicSideMenuDelegate, $rootScope, $http, $q, $state, $ionicLoading, $ionicPopover, $ionicScrollDelegate, $ionicModal, $timeout, zmAutoLogin, $ionicHistory, EventServer, $translate, $ionicPopup) { var processPush = false; var broadcastHandles = []; @@ -436,6 +436,20 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic NVRDataModel.getTimeZone(); EventServer.init(); + NVRDataModel.zmPrivacyProcessed() + .then (function (val) { + console.log(">>>>>>>>>>>>>>>>>>> PRIVACY PROCEESSED:"+val); + if (!val) { + var alertPopup = $ionicPopup.alert({ + title: $translate.instant ('kNote'), + template: $translate.instant('kDataPrivacyZM'), + okText: $translate.instant('kButtonOk'), + cancelText: $translate.instant('kButtonCancel'), + }); + + } + }); + // if push broadcast happens BEFORE this, then no // state change will occur here which is good diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index 76b42f72..33197246 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -50,7 +50,8 @@ "kCycleMonitors" :"cycle monitors", "kCycleMonitorsInterval" :"monitor cycle interval", "kCycleMontageInterval" :"montage cycle interval", - "kDataPrivacy" : "Data Privacy", + "kDataPrivacy" :"Data Privacy", + "kDataPrivacyZM" : "zmNinja will not function properly till your process ZoneMinder's Privacy Policy. Please open ZoneMinder web console and accept or reject it.", "kDay" :"Day", "kDecreaseSize" :"decrease size", "kDelete" :"Delete", |
