summaryrefslogtreecommitdiff
path: root/www/js/LoginCtrl.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2019-05-18 13:29:28 -0400
committerPliable Pixels <pliablepixels@gmail.com>2019-05-18 13:29:28 -0400
commit12c8516a9f8151f22588d4a0fb42530b85265c6f (patch)
tree21f0b92bfaec752c8f8c496c5285389f6a6efcce /www/js/LoginCtrl.js
parent41e8490439876ff4a33e4b3c5f4695b750c283d2 (diff)
#817 various intercept fixes
Diffstat (limited to 'www/js/LoginCtrl.js')
-rw-r--r--www/js/LoginCtrl.js99
1 files changed, 23 insertions, 76 deletions
diff --git a/www/js/LoginCtrl.js b/www/js/LoginCtrl.js
index 7cf46cac..53796832 100644
--- a/www/js/LoginCtrl.js
+++ b/www/js/LoginCtrl.js
@@ -784,85 +784,32 @@ function mobilePinConfig () {
var loginStatus = $translate.instant('kExploreEnjoy') + " " + $rootScope.appName + "!";
EventServer.refresh();
- // now grab and report PATH_ZMS
- NVR.getPathZms()
+ NVR.debug("refreshing API version...");
+ NVR.getAPIversion()
.then(function (data) {
- var ld = NVR.getLogin();
- var zm_cgi = data.toLowerCase();
-
- var user_cgi = (ld.streamingurl).toLowerCase();
- NVR.log("ZM relative cgi-path: " + zm_cgi + ", you entered: " + user_cgi);
-
- $http.get(ld.streamingurl + "/zms")
- .then(function (data) {
- data = data.data;
- NVR.debug("Urk! cgi-path returned success, but it should not have come here");
- loginStatus = $translate.instant('kLoginStatusNoCgi');
-
- NVR.debug("refreshing API version...");
- NVR.getAPIversion()
- .then(function (data) {
- var refresh = NVR.getMonitors(1);
- $rootScope.apiVersion = data;
- },
- function (error) {
- var refresh = NVR.getMonitors(1);
- $rootScope.apiVersion = "0.0.0";
- NVR.debug("Error, failed API version, setting to " + $rootScope.apiVersion);
- });
-
- if (showalert) {
- $rootScope.zmPopup = SecuredPopups.show('alert', {
- title: $translate.instant('kLoginValidatedTitle'),
- template: loginStatus,
- okText: $translate.instant('kButtonOk'),
- cancelText: $translate.instant('kButtonCancel'),
- }).then(function (res) {
-
- $ionicSideMenuDelegate.toggleLeft();
- NVR.debug("Force reloading monitors...");
-
- });
- }
- },
- function (error, status) {
- // If its 5xx, then the cgi-bin path is valid
- // if its 4xx then the cgi-bin path is not valid
-
- if (status < 500) {
- loginStatus = $translate.instant('kLoginStatusNoCgiAlt');
- }
-
- if (showalert) {
- $rootScope.zmPopup = SecuredPopups.show('alert', {
- title: $translate.instant('kLoginValidatedTitle'),
- template: loginStatus,
- okText: $translate.instant('kButtonOk'),
- cancelText: $translate.instant('kButtonCancel'),
- }).then(function (res) {
-
- $ionicSideMenuDelegate.toggleLeft();
- NVR.debug("Force reloading monitors...");
-
- });
- } else // make sure CGI error is always shown
- {
- NVR.displayBanner((status < 500) ? 'error' : 'info', [loginStatus]);
- }
- NVR.debug("refreshing API version...");
- NVR.getAPIversion()
- .then(function (data) {
- var refresh = NVR.getMonitors(1);
- $rootScope.apiVersion = data;
- },
- function (error) {
- var refresh = NVR.getMonitors(1);
- $rootScope.apiVersion = "0.0.0";
- NVR.debug("Error, failed API version, setting to " + $rootScope.apiVersion);
- });
+ var refresh = NVR.getMonitors(1);
+ $rootScope.apiVersion = data;
+ console.log ("ALERT="+showalert);
+ if (showalert) {
+ $rootScope.zmPopup = SecuredPopups.show('alert', {
+ title: $translate.instant('kLoginValidatedTitle'),
+ template: loginStatus,
+ okText: $translate.instant('kButtonOk'),
+ cancelText: $translate.instant('kButtonCancel'),
+ }).then(function (res) {
+
+ $ionicSideMenuDelegate.toggleLeft();
+ NVR.debug("Force reloading monitors...");
});
- });
+ }
+
+ },
+ function (error) {
+ var refresh = NVR.getMonitors(1);
+ $rootScope.apiVersion = "0.0.0";
+ NVR.debug("Error, failed API version, setting to " + $rootScope.apiVersion);
+ });
},
function (error) {