summaryrefslogtreecommitdiff
path: root/www/js/PortalLoginCtrl.js
diff options
context:
space:
mode:
author= <=>2019-03-14 14:22:29 -0400
committer= <=>2019-03-14 14:22:29 -0400
commit7cb24d55f47dc28d91710d5c22cfc30a0a59b583 (patch)
treedcca268fc1c95ae4233951e928a370992647f5a8 /www/js/PortalLoginCtrl.js
parent9e1e17a259fc206a70cb4bf6c8142059510003f2 (diff)
#784 well what the heck, password for desktops
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
-rw-r--r--www/js/PortalLoginCtrl.js52
1 files changed, 48 insertions, 4 deletions
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js
index 95967ed0..35572166 100644
--- a/www/js/PortalLoginCtrl.js
+++ b/www/js/PortalLoginCtrl.js
@@ -95,7 +95,49 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
NVR.setLogin(ld);
unlock(true);
- } else if ($ionicPlatform.is('android') && loginData.usePin) {
+ }
+
+ else if ($rootScope.platformOS == 'desktop' && loginData.usePin) {
+
+ $scope.passwdData = {};
+ var myPopup = $ionicPopup.show({
+ template: '<input type="password" ng-model="passwdData.pass">',
+ title: $translate.instant('kPinProtect'),
+ scope: $scope,
+ buttons: [
+
+ {
+ text: $translate.instant('kButtonOk'),
+ type: 'button-positive',
+ onTap: function(e) {
+ if (!$scope.passwdData.pass) {
+ //don't allow the user to close unless he enters wifi password
+ e.preventDefault();
+ } else {
+ if ($scope.passwdData.pass == loginData.pinCode) {
+ NVR.log ("Pin code match");
+ unlock(true);
+ }
+ else {
+ $ionicLoading.show({
+ template: $translate.instant('kBannerPinMismatch') + "...",
+ noBackdrop: true,
+ duration: 1500
+ });
+ NVR.log ("Pin code mistmatch match");
+ e.preventDefault();
+ }
+
+ }
+ }
+ }
+ ]
+ });
+
+
+
+ }
+ else if ($ionicPlatform.is('android') && loginData.usePin) {
FingerprintAuth.isAvailable(function (result) {
NVR.debug("FingerprintAuth available: " + JSON.stringify(result));
@@ -166,12 +208,14 @@ angular.module('zmApp.controllers').controller('zmApp.PortalLoginCtrl', ['$ionic
NVR.log("not checking for touchID");
}
- if (loginData.usePin) {
+ if (loginData.usePin ) {
// this shows the pin prompt on screen
- $scope.pinPrompt = true;
+ if ($rootScope.platformOS != 'desktop') {
+ $scope.pinPrompt = true;
+ }
// dont call unlock, let the user type in code
- } else // no PIN Code so go directly to auth
+ } else // no PIN Code so go directly to auth
{
unlock(true);