diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2019-07-08 16:52:21 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2019-07-08 16:52:21 -0400 |
| commit | 18bec317d7b1ac7cd9794e1b2236beb864186bf4 (patch) | |
| tree | 3bcfacba58a03d414d7de4dcdcbd43635ca17978 /www/js/PortalLoginCtrl.js | |
| parent | f683ea8023b71ab705ca37ea6ff60daa22c24a72 (diff) | |
#830 lockdown kiosk mode initial implementation
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 86 |
1 files changed, 31 insertions, 55 deletions
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js index 35572166..17715238 100644 --- a/www/js/PortalLoginCtrl.js +++ b/www/js/PortalLoginCtrl.js @@ -289,44 +289,23 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic var ld = NVR.getLogin(); if (NVR.versionCompare(data, zm.minAppVersion) == -1 && data != "0.0.0") { - $state.go('app.lowversion', { - "ver": data - }); - return; - } - - if (NVR.versionCompare(data, zm.recommendedAppVersion) == -1 && data != "0.0.0") { - - NVR.hrsSinceChecked("zmVersion") - .then(function (val) { - NVR.debug("ZM Version nag: Checking " + val + " with " + zm.zmVersionCheckNag); - if (val >= zm.zmVersionCheckNag && 0) { - NVR.updateHrsSinceChecked("zmVersion"); - $state.go('app.importantmessage', { - "ver": data - }); - return; - } + $rootScope.importantMessageHeader = $translate.instant('kImportant'); + $rootScope.importantMessageSummary = $translate.instant('kVersionIncompatible', {currentVersion: data, minVersion: zm.minAppVersion}); - }); + $state.go('app.importantmessage'); + return; } - /*if (data == "0.0.0") - { - - NVR.log("2nd Auth:API getVersion succeeded but returned 0.0.0 " + JSON.stringify(data)); - NVR.displayBanner('error', ['ZoneMinder authentication failed']); - $state.go("login", - { - "wizard": false - }); - return; - }*/ - // coming here means continue - //EventServer.init(); + var statetoGo = $rootScope.lastState ? $rootScope.lastState : 'app.montage'; + if ($rootScope.LoginData.isKiosk) { + NVR.log ('>>> You are in kiosk mode'); + statetoGo = 'app.montage'; + $rootScope.lastStateParam=''; + + } //NVR.debug ("logging state transition"); NVR.debug("2nd Auth: Transitioning state to: " + statetoGo + " with param " + JSON.stringify($rootScope.lastStateParam)); @@ -384,35 +363,22 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic NVR.log("Got API version: " + data); $rootScope.apiVersion = data; var ld = NVR.getLogin(); + console.log (">>>>>>>> COMPARING "+data+" to "+zm.minAppVersion); if (NVR.versionCompare(data, zm.minAppVersion) == -1 && data != "0.0.0") { - $state.go('app.lowversion', { - "ver": data + $rootScope.importantMessageHeader = $translate.instant('kImportant'); + $rootScope.importantMessageSummary = $translate.instant('kVersionIncompatible', {currentVersion: data, minVersion: zm.minAppVersion}); + $ionicHistory.nextViewOptions({ + disableAnimate:true, + disableBack: true }); - return; - } - - if (NVR.versionCompare(data, zm.recommendedAppVersion) == -1 && data != "0.0.0") { - - NVR.hrsSinceChecked("zmVersion") - .then(function (val) { - - NVR.debug("ZM Version nag: Checking " + val + " with " + zm.zmVersionCheckNag); - if (val >= zm.zmVersionCheckNag && 0) { - //https://api.github.com/repos/zoneminder/zoneminder/releases/latest - //tag_name - NVR.updateHrsSinceChecked("zmVersion"); - $state.go('app.importantmessage', { - "ver": data - }); - return; - - } - - }); + $state.go('app.importantmessage'); + return; } + + /*if (data == "0.0.0") { @@ -459,9 +425,19 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic if (!processPush) { alreadyTransitioned = true; + + if ($rootScope.LoginData.isKiosk) { + NVR.log ('>>> You are in kiosk mode'); + statetoGo = 'app.montage'; + $rootScope.lastStateParam=''; + + } + NVR.debug("Transitioning state to: " + statetoGo + " with param " + JSON.stringify($rootScope.lastStateParam)); + + $state.go(statetoGo, $rootScope.lastStateParam); return; } |
