diff options
Diffstat (limited to 'www/js')
| -rwxr-xr-x | www/js/DataModel.js | 15 | ||||
| -rw-r--r-- | www/js/EventCtrl.js | 25 | ||||
| -rw-r--r-- | www/js/MomentCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/MonitorModalCtrl.js | 8 | ||||
| -rw-r--r-- | www/js/MontageCtrl.js | 2 | ||||
| -rw-r--r-- | www/js/TimelineModalCtrl.js | 3 |
6 files changed, 35 insertions, 20 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 455e4c0a..e94ea0a4 100755 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -183,6 +183,7 @@ angular.module('zmApp.controllers') 'momentArrangeBy': 'StartTime', 'showLiveForInProgressEvents': true, 'disableSimulStreaming': false, + 'insertBasicAuthToken': false, }; @@ -589,6 +590,14 @@ angular.module('zmApp.controllers') return { + + + insertBasicAuthToken: function () { + + return loginData.insertBasicAuthToken && $rootScope.basicAuthToken ? "&basicauth="+$rootScope.basicAuthToken:""; + + }, + setCurrentServerMultiPortSupported:function (val) { setCurrentServerMultiPortSupported(val); }, @@ -1258,6 +1267,12 @@ angular.module('zmApp.controllers') loginData.momentArrangeBy = "StartTime"; } + + if (typeof loginData.insertBasicAuthToken == 'undefined') { + + loginData.insertBasicAuthToken = false; + + } if (typeof loginData.showLiveForInProgressEvents == 'undefined') { diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js index 5604ff8d..666f7c7f 100644 --- a/www/js/EventCtrl.js +++ b/www/js/EventCtrl.js @@ -965,10 +965,10 @@ angular.module('zmApp.controllers') $scope.fallbackImgSrc +=$rootScope.authSession; } - if ($rootScope.basicAuthToken) { - $scope.imgsrc +="&basicauth="+$rootScope.basicAuthToken; - $scope.fallbackImgSrc +="&basicauth="+$rootScope.basicAuthToken; - } + + $scope.imgsrc +=NVRDataModel.insertBasicAuthToken(); + $scope.fallbackImgSrc +=NVRDataModel.insertBasicAuthToken(); + $rootScope.zmPopup = $ionicPopup.show( @@ -2479,9 +2479,9 @@ angular.module('zmApp.controllers') /* videoURL = event.Event.baseURL + "/events/" + event.Event.relativePath + event.Event.DefaultVideo;*/ videoURL = event.Event.baseURL + "/index.php?view=view_video&eid=" + event.Event.Id; if ($rootScope.authSession != 'undefined') videoURL +=$rootScope.authSession; - if ($rootScope.basicAuthToken) videoURL = videoURL+"&basicauth="+$rootScope.basicAuthToken; - - + vidoeURL+=NVRDataModel.insertBasicAuthToken(); + + console.log("************** VIDEO IS " + videoURL); event.Event.video.config = { autoPlay: true, @@ -3159,7 +3159,8 @@ angular.module('zmApp.controllers') "&width="+event.Event.thumbWidth*2 + "&height="+event.Event.thumbHeight*2; if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; - if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + + stream += NVRDataModel.insertBasicAuthToken(); return stream; }; @@ -3177,7 +3178,9 @@ angular.module('zmApp.controllers') "&fid="+slide.id; } if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; - if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + + stream +=NVRDataModel.insertBasicAuthToken(); + return stream; } @@ -3201,8 +3204,8 @@ angular.module('zmApp.controllers') } if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; - if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; - + stream += NVRDataModel.insertBasicAuthToken(); + return stream; }; diff --git a/www/js/MomentCtrl.js b/www/js/MomentCtrl.js index 06658e0e..97f864b7 100644 --- a/www/js/MomentCtrl.js +++ b/www/js/MomentCtrl.js @@ -265,7 +265,7 @@ angular.module('zmApp.controllers').controller('zmApp.MomentCtrl', ['$scope', '$ "&height="+moment.Event.thumbHeight*2; if ($rootScope.authSession != 'undefined') stream +=$rootScope.authSession; - if ($rootScope.basicAuthToken) stream = stream+"&basicauth="+$rootScope.basicAuthToken; + stream += NVRDataModel.insertBasicAuthToken(); return stream; }; diff --git a/www/js/MonitorModalCtrl.js b/www/js/MonitorModalCtrl.js index ed81cd4e..49fe3741 100644 --- a/www/js/MonitorModalCtrl.js +++ b/www/js/MonitorModalCtrl.js @@ -1086,10 +1086,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ url +=$rootScope.authSession; } - if ($rootScope.basicAuthToken) { - url +="&basicauth="+$rootScope.basicAuthToken; - - } + url += NVRDataModel.insertBasicAuthToken(); NVRDataModel.log("SavetoPhone:Trying to save image from " + url); @@ -1153,8 +1150,7 @@ angular.module('zmApp.controllers').controller('MonitorModalCtrl', ['$scope', '$ //console.log ("STREAM="+stream); - if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; - + stream += NVRDataModel.insertBasicAuthToken(); return stream; diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index be20a340..0809fabc 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -1714,7 +1714,7 @@ angular.module('zmApp.controllers') $rootScope.authSession + appendConnKey(monitor.Monitor.connKey); - if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + stream += NVRDataModel.insertBasicAuthToken(); //"&rand=" + randToAvoidCacheMem; diff --git a/www/js/TimelineModalCtrl.js b/www/js/TimelineModalCtrl.js index d442b47d..fb1e480f 100644 --- a/www/js/TimelineModalCtrl.js +++ b/www/js/TimelineModalCtrl.js @@ -64,7 +64,8 @@ angular.module('zmApp.controllers').controller('TimelineModalCtrl', ['$scope', ' } if ($rootScope.authSession !='undefined') stream+=$rootScope.authSession; - if ($rootScope.basicAuthToken) stream +="&basicauth="+$rootScope.basicAuthToken; + + stream+= NVRDataModel.insertBasicAuthToken(); return stream; }; |
