summaryrefslogtreecommitdiff
path: root/www/js/DataModel.js
diff options
context:
space:
mode:
authorPliablePixels <pliablepixels@gmail.com>2015-09-01 12:07:38 -0400
committerPliablePixels <pliablepixels@gmail.com>2015-09-01 12:07:38 -0400
commit92ad611c1092a9f8063dea5dfb4d9832d5a92368 (patch)
treefc295500fa9256462bf677a57cc9498d79cfd2a1 /www/js/DataModel.js
parent791dabbf04e0ce8b087346f0e111a2d25310d24d (diff)
Added code that checks if google reCaptcha is enabled in ZM - if so, displays error (zmNinja won't work with reCaptcha)
Diffstat (limited to 'www/js/DataModel.js')
-rw-r--r--www/js/DataModel.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 48a09b52..2068b497 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -281,6 +281,33 @@ angular.module('zmApp.controllers').service('ZMDataModel', ['$http', '$q', '$ion
displayBanner (mytype, mytext, myinterval, mytimer);
},
+ isReCaptcha: function()
+ {
+ var d=$q.defer();
+ var myurl =loginData.url;
+ zmLog ("Checking of reCaptcha is enabled in ZM...");
+ $http.get(myurl)
+ .then (function (success) {
+ if (success.data.search("g-recaptcha") != -1 )
+ {
+ // recaptcha enable. zmNinja won't work
+ zmLog ("ZM has recaptcha enabled", "error");
+ displayBanner ('error', ['Recaptcha must be disabled in Zoneminder', 'zmNinja will not work with recaptcha'],"",8000);
+ d.resolve(true);
+ return (d.promise);
+
+
+ }
+ else
+ {
+ d.resolve(false);
+ zmLog ("ZM has recaptcha disabled - good");
+ return (d.promise);
+ }
+ });
+ return (d.promise);
+ },
+
//-----------------------------------------------------------------------------
// Grabs the computed auth key for streaming
// FIXME: Currently a hack - does a screen parse - convert to API based support