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/LoginCtrl.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/LoginCtrl.js')
| -rw-r--r-- | www/js/LoginCtrl.js | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js index 05631b1d..3b5b368b 100644 --- a/www/js/LoginCtrl.js +++ b/www/js/LoginCtrl.js @@ -2,7 +2,7 @@ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console */ -angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$rootScope','zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicPopup', '$http', '$q', '$ionicLoading', function ($scope, $rootScope,zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicPopup, $http, $q, $ionicLoading) { +angular.module('zmApp.controllers').controller('zmApp.LoginCtrl', ['$scope', '$rootScope','zm', '$ionicModal', 'ZMDataModel', '$ionicSideMenuDelegate', '$ionicPopup', '$http', '$q', '$ionicLoading', 'zmAutoLogin', function ($scope, $rootScope,zm, $ionicModal, ZMDataModel, $ionicSideMenuDelegate, $ionicPopup, $http, $q, $ionicLoading, zmAutoLogin) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -137,7 +137,7 @@ function addhttp(url) { // Let's do a sanity check to see if the URLs are ok - +/* $ionicLoading.show({ template: 'Checking data...', animation: 'fade-in', @@ -145,16 +145,26 @@ function addhttp(url) { duration: zm.loadingTimeout, maxWidth: 200, showDelay: 0 - }); - + });*/ +/* + FIXME: REDO this $q.all([ - $http.get(apiurl), + // $http.get(apiurl), $http.get(portalurl), //$http.get(streamingurl), ]).then( function (results) { $ionicLoading.hide(); + $http.get(apiurl) + .then (function (data) + { + }, + function (err) + { + }); + + $ionicPopup.alert({ title: 'Settings Saved', template: 'Please explore the menu and enjoy zmNinja!' @@ -189,8 +199,19 @@ function addhttp(url) { } - ); + );*/ ZMDataModel.setLogin($scope.loginData); + zmAutoLogin.doLogin("Logging into ZoneMinder") + .then( function(data) + { + + console.log ("THE DATA WAS " + data); + $ionicPopup.alert({ + title: 'Settings Saved', + template: 'Please explore the menu and enjoy zmNinja!' + }).then(function(res) { $ionicSideMenuDelegate.toggleLeft();}); + }); + }; |
