summaryrefslogtreecommitdiff
path: root/www/js/DataModel.js
diff options
context:
space:
mode:
authorpliablepixels <pliablepixels@gmail.com>2016-01-29 14:17:35 -0500
committerpliablepixels <pliablepixels@gmail.com>2016-01-29 14:17:35 -0500
commita3090dd2d4af0de8829464874f572e1caed8e76c (patch)
tree57834d955742c88aadc4ff1b81366347e16860ce /www/js/DataModel.js
parent77bc8857ccaf16c70a68f95f750191b469bf07ff (diff)
#154 and #155 various updates, also ties into https://github.com/ZoneMinder/ZoneMinder/issues/1253
Former-commit-id: 7f939b4bad5d9463a7653abbdcafd79d8a6c1fa8
Diffstat (limited to 'www/js/DataModel.js')
-rw-r--r--www/js/DataModel.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 88a0ac38..28228e1c 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -64,6 +64,7 @@ angular.module('zmApp.controllers')
'useNphZms':true,
'packMontage':true,
'exitOnSleep':false,
+ 'forceNetworkStop':false
};
@@ -243,6 +244,13 @@ angular.module('zmApp.controllers')
loginData.packMontage = true;
}
+ if (typeof loginData.forceNetworkStop == 'undefined')
+ {
+ zmDebug ("forceNetwork does not exist. Setting to false");
+ loginData.forceNetworkStop = false;
+ }
+
+
if (typeof loginData.exitOnSleep == 'undefined')
{
@@ -263,6 +271,11 @@ angular.module('zmApp.controllers')
zmDebug ( "loginData structure values: " + JSON.stringify(loginData));
},
+
+ isForceNetworkStop: function()
+ {
+ return loginData.forceNetworkStop;
+ },
isLoggedIn: function () {
@@ -491,7 +504,7 @@ angular.module('zmApp.controllers')
// need a mid as restricted users won't be able to get
// auth with just &watch
- getAuthKey: function (mid)
+ getAuthKey: function (mid, ck)
{
var d=$q.defer();
@@ -504,7 +517,7 @@ angular.module('zmApp.controllers')
// Skipping monitor number as I only need an auth key
// so no need to generate an image
- var myurl =loginData.url+"/index.php?view=watch&mid="+mid;
+ var myurl =loginData.url+"/index.php?view=watch&mid="+mid+"&connkey="+ck;
zmDebug ("DataModel: Getting auth from " + myurl + " with mid="+mid);
$http.get (myurl)
.then (function (success) {
@@ -776,6 +789,10 @@ angular.module('zmApp.controllers')
{
monitors[i].Monitor.listDisplay='show';
monitors[i].Monitor.isAlarmed = 'false';
+ monitors[i].Monitor.connKey = monitors[i].Monitor.Id.toString() + Math.floor((Math.random() * 100000) + 1);
+ zmLog("ConnKey for "+monitors[i].Monitor.Id+" is :"+monitors[i].Monitor.connKey);
+
+
// monitors[i].Monitor.sortOrder=i;
}
d.resolve(monitors);