diff options
| author | PliablePixels <pliablepixels@gmail.com> | 2015-08-07 20:33:53 -0400 |
|---|---|---|
| committer | PliablePixels <pliablepixels@gmail.com> | 2015-08-07 20:33:53 -0400 |
| commit | c854d6c9189298487cd698934f96be28b1bc9bad (patch) | |
| tree | c3563b85c2382470992a529442c41c8eeb80e63b /www/js/PortalLoginCtrl.js | |
| parent | 3aa6aed4d45f536a93f1b25432cd41f47a1ce466 (diff) | |
Lots of refactoring - API is not tied into Portal Auth - bugs may need to be ironed out
Diffstat (limited to 'www/js/PortalLoginCtrl.js')
| -rw-r--r-- | www/js/PortalLoginCtrl.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/www/js/PortalLoginCtrl.js b/www/js/PortalLoginCtrl.js new file mode 100644 index 00000000..65f92b48 --- /dev/null +++ b/www/js/PortalLoginCtrl.js @@ -0,0 +1,36 @@ +/* jshint -W041 */ +/* jshint -W083 */ +/*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', 'ZMDataModel', '$ionicSideMenuDelegate', '$rootScope', '$http', '$q', '$state', '$ionicLoading', '$ionicPopover', '$ionicScrollDelegate', '$ionicModal', '$timeout', 'zmAutoLogin', '$ionicHistory',function ($ionicPlatform, $scope, zm, ZMDataModel, $ionicSideMenuDelegate, $rootScope, $http, $q, $state, $ionicLoading, $ionicPopover, $ionicScrollDelegate, $ionicModal, $timeout, zmAutoLogin, $ionicHistory) { + + // Main + +console.log ("***** INSIDE LOGIN CONTROLLER"); + + $ionicHistory.nextViewOptions({ + disableBack: true + }); + + var loginData = ZMDataModel.getLogin(); + + if (ZMDataModel.isLoggedIn()) { + ZMDataModel.zmLog ("User credentials are provided"); + // console.log("VALID CREDENTIALS. Grabbing Monitors"); + zmAutoLogin.doLogin("Logging into ZoneMinder...") + .then (function(data) + { + + ZMDataModel.getKeyConfigParams(1); + $state.go('montage'); + }); + } + else + { + $state.go('login'); + + } + + + }]);
\ No newline at end of file |
