From 2a7699ac57249422b09951cecf8f93c641634990 Mon Sep 17 00:00:00 2001 From: PliablePixels Date: Tue, 15 Sep 2015 14:41:54 -0400 Subject: Fixed the colossal crap that was PIN code auth. Still need to clean up rough edges but overall looks good now --- www/js/DataModel.js | 75 ++--------------------------------------------------- 1 file changed, 2 insertions(+), 73 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index ab1ce647..85a29471 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -41,6 +41,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', 'ZM_EVENT_IMAGE_DIGITS':'-1' }; + //-------------------------------------------------------------------------- // uses fileLogger to write logs to file for later investigation //-------------------------------------------------------------------------- @@ -382,79 +383,7 @@ angular.module('zmApp.controllers').service('ZMDataModel', // Grabs the computed auth key for streaming // FIXME: Currently a hack - does a screen parse - convert to API based support //----------------------------------------------------------------------------- - validatePin: function() - { - - var d=$q.defer(); - if (loginData.usePin) - { - zmDebug("Validating PIN..."); - var pinMatch = false; - - // - $rootScope.pindata={}; - var pinPrompt = $ionicPopup.show({ - template: '', - title: 'PIN validation', - subtitle: 'Please confirm your PIN', - scope: $rootScope, - buttons: [ - { - text: 'Ok', - type:'button-positive', - onTap: function(e) - { - if ($rootScope.pindata.pin != loginData.pinCode) - { - displayBanner("error",["Invalid PIN. Please try again"]); - zmLog("Invalid PIN entered "); - e.preventDefault(); - $rootScope.pindata.pin=""; - } - else - { - zmLog("PIN was correct"); - d.resolve(true); - } - - } - }, - ]}); - return (d.promise); - /*$cordovaPinDialog.prompt ('Enter PIN', 'PIN Confirm', ["OK"]) - .then( function (result) - { - if (result.input1 != loginData.pinCode) - { - displayBanner("error",["Invalid PIN. Please try again"]); - zmLog("Invalid PIN entered, looping..."); - d.resolve(false); - } - else - { - pinMatch = true; - zmLog("Valid PIN entered"); - d.resolve(true); - } - }, - - function (error) - { - zmLog("PIN error handler. Should not come here"); - d.resolve(false); - });*/ - - - - } - else - { - zmDebug("No PIN set, skipping"); - d.resolve(true); - return (d.promise); - - } - }, + getAuthKey: function () { -- cgit v1.2.3