diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-28 14:29:43 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-28 14:29:43 -0400 |
| commit | ebe04f8fc791413131c37425998be5be4a2ef538 (patch) | |
| tree | a8f6e6a15c9e3125f20e9081c59755911a8253bb /www/js/MenuController.js | |
| parent | d8fea09d65e5207ef8c4fafcddd5fc74a7f7be00 (diff) | |
#709 dont escape urls in caller, incorporate cordova http ssl and basic auth checks
Diffstat (limited to 'www/js/MenuController.js')
| -rw-r--r-- | www/js/MenuController.js | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/www/js/MenuController.js b/www/js/MenuController.js index 8de4aeb3..1ab7a6fa 100644 --- a/www/js/MenuController.js +++ b/www/js/MenuController.js @@ -2,14 +2,14 @@ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console */ -angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory', '$state', 'NVRDataModel', '$rootScope', '$ionicPopup', '$translate', '$timeout', '$location','EventServer', 'zmAutoLogin','$http',function ($scope, $ionicSideMenuDelegate, zm, $stateParams, $ionicHistory, $state, NVRDataModel, $rootScope, $ionicPopup, $translate, $timeout, $location, EventServer, zmAutoLogin, $http) { +angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$ionicSideMenuDelegate', 'zm', '$stateParams', '$ionicHistory', '$state', 'NVRDataModel', '$rootScope', '$ionicPopup', '$translate', '$timeout', '$location','EventServer', 'zmAutoLogin','$http','SecuredPopups',function ($scope, $ionicSideMenuDelegate, zm, $stateParams, $ionicHistory, $state, NVRDataModel, $rootScope, $ionicPopup, $translate, $timeout, $location, EventServer, zmAutoLogin, $http, SecuredPopups) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; //---------------------------------------------------------------- // This controller sits along with the main app to bring up - // the language menu from the main menu + // the language menu from the main //---------------------------------------------------------------- @@ -83,6 +83,33 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io } + + if (window.cordova) { + + if (loginData.isUseBasicAuth) { + NVRDataModel.debug ("Cordova HTTP: configuring basic auth"); + cordova.plugin.http.useBasicAuth(loginData.basicAuthUser, loginData.basicAuthPassword); + } + + if (loginData.enableStrictSSL) { + + //alert("Enabling insecure SSL"); + NVRDataModel.log(">>>> Disabling strict SSL checking (turn off in Dev Options if you can't connect)"); + cordova.plugin.http.setSSLCertMode('nocheck', function() { + NVRDataModel.debug('--> SSL is permissive, will allow any certs. Use at your own risk.'); + }, function() { + console.log('-->Error setting SSL permissive'); + }); + + } else { + + NVRDataModel.log(">>>> Enabling strict SSL checking (turn off in Dev Options if you can't connect)"); + + } + + } + + if (loginData.isUseEventServer) { EventServer.init(); if ($rootScope.apnsToken && loginData.disablePush != true) { |
