diff options
Diffstat (limited to 'www/js/app.js')
| -rwxr-xr-x | www/js/app.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/www/js/app.js b/www/js/app.js index 36a730c1..9bf7e0a7 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -617,7 +617,7 @@ angular.module('zmApp', [ .factory('timeoutHttpIntercept', ['$rootScope', '$q', 'zm', '$injector', function ($rootScope, $q, zm, $injector) { $rootScope.zmCookie = ""; //console.log ("HHHHHHHHHHHHHH**************************"); - + //console.log ("HERE TIMEOUT"); return { 'request': function (config) { @@ -646,6 +646,7 @@ angular.module('zmApp', [ if ($rootScope.zmCookie) { config.headers.Cookie = "ZMSESSID=" + $rootScope.zmCookie; + // console.log (">>>>> WOOOT HAVE COOKIE AND USING: "+$rootScope.zmCookie); } else { // console.log ("No cookie present in " + config.url); } @@ -690,7 +691,7 @@ angular.module('zmApp', [ if (zmSess) { if (zmSess[1]) { - // console.log ("***** SETTING COOKIE TO " + zmCookie); + //console.log ("***** SETTING COOKIE TO " + zmCookie); $rootScope.zmCookie = zmSess[1]; } } @@ -910,13 +911,23 @@ angular.module('zmApp', [ // which actually means auth failed, but ZM treats it as a success //------------------------------------------------------------------ - function doLogin(str) { + + function doLogoutAndLogin(str) { + return NVRDataModel.logout() + .finally(function(ans) { + doLogin(str); + + }); + } + function doLogin(str) { var d = $q.defer(); var ld = NVRDataModel.getLogin(); + console.log ("INSIDE REAL DO LOGIN"); + /*$rootScope.authSession = 'Test'; $rootScope.apiAuth = true; d.resolve ("Login Success"); @@ -1230,7 +1241,7 @@ angular.module('zmApp', [ return { start: start, stop: stop, - doLogin: doLogin + doLogin: doLogoutAndLogin }; }) @@ -1721,7 +1732,7 @@ angular.module('zmApp', [ }); $fileLogger.setStorageFilename(zm.logFile); - $fileLogger.setTimestampFormat('MMM d, y ' + NVRDataModel.getTimeFormat()); + $fileLogger.setTimestampFormat('MMM d, y ' + NVRDataModel.getTimeFormatSec()); if (NVRDataModel.getLogin().disableNative) { NVRDataModel.log("Disabling native transitions..."); |
