summaryrefslogtreecommitdiff
path: root/www/js/MenuController.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2019-07-08 16:52:21 -0400
committerPliable Pixels <pliablepixels@gmail.com>2019-07-08 16:52:21 -0400
commit18bec317d7b1ac7cd9794e1b2236beb864186bf4 (patch)
tree3bcfacba58a03d414d7de4dcdcbd43635ca17978 /www/js/MenuController.js
parentf683ea8023b71ab705ca37ea6ff60daa22c24a72 (diff)
#830 lockdown kiosk mode initial implementation
Diffstat (limited to 'www/js/MenuController.js')
-rw-r--r--www/js/MenuController.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/www/js/MenuController.js b/www/js/MenuController.js
index 48ee5d0d..590b927d 100644
--- a/www/js/MenuController.js
+++ b/www/js/MenuController.js
@@ -45,6 +45,55 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io
};
+ $scope.exitKiosk = function() {
+ $scope.data = {};
+ // An elaborate, custom popup
+ var myPopup = $ionicPopup.show({
+ template: '<small>'+$translate.instant('kKioskPassword')+'</small><input type="password" ng-model="data.p1"><br/><small>',
+ title: $translate.instant('kPassword'),
+ scope: $scope,
+ buttons: [
+ { text: 'Cancel',
+ type: 'button-assertive',
+ onTap: function (e) {
+ $scope.loginData.isKiosk = false;
+ }
+ },
+ {
+ text: '<b>'+$translate.instant('kButtonSave')+'</b>',
+ type: 'button-positive',
+ onTap: function(e) {
+ if (!$scope.data.p1) {
+ //don't allow the user to close unless he enters wifi password
+ e.preventDefault();
+ } else {
+ var ld = NVR.getLogin();
+ if ($scope.data.p1 == ld.kioskPassword) {
+ ld.isKiosk = false;
+ NVR.setLogin(ld);
+ }
+ else {
+ $ionicLoading.show({
+ template: $translate.instant('kBannerPinMismatch') + "...",
+ noBackdrop: true,
+ duration: 1500
+ });
+ NVR.log ("Kiosk code mistmatch");
+ $scope.loginData.isKiosk = false;
+ e.preventDefault();
+ }
+
+ }
+ }
+ }
+ ]
+ });
+
+
+
+
+ };
+
function switchToServer(s) {
$rootScope.alarmCount = 0;