diff options
Diffstat (limited to 'www/js/WizardCtrl.js')
| -rw-r--r-- | www/js/WizardCtrl.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index f4b3d456..8a5f1ac4 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -2,7 +2,7 @@ /* jslint browser: true*/ /* global cordova,StatusBar,angular,console, Masonry, URI */ -angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$ionicPopup', 'SecuredPopups', '$http', '$q', 'zm', '$ionicLoading', 'WizardHandler', '$translate', function ($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $ionicPopup, SecuredPopups, $http, $q, zm, $ionicLoading, WizardHandler, $translate) { +angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$rootScope', '$ionicModal', 'NVRDataModel', '$ionicSideMenuDelegate', '$ionicHistory', '$state', '$ionicPopup', 'SecuredPopups', '$http', '$q', 'zm', '$ionicLoading', 'WizardHandler', '$translate', '$cookies', function ($scope, $rootScope, $ionicModal, NVRDataModel, $ionicSideMenuDelegate, $ionicHistory, $state, $ionicPopup, SecuredPopups, $http, $q, zm, $ionicLoading, WizardHandler, $translate, $cookies) { $scope.openMenu = function () { $ionicSideMenuDelegate.toggleLeft(); }; @@ -342,6 +342,26 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ function logout(u) { var d = $q.defer(); + NVRDataModel.debug ("Clearing cookies"); + if (window.cordova) { + // we need to do this or ZM will send same auth hash + // this was fixed in a PR dated Oct 18 + + cordova.plugin.http.clearCookies(); + } + else { + angular.forEach($cookies, function (v, k) { + $cookies.remove(k); + }); + } + + if ($scope.wizard.useauth && $scope.wizard.usebasicauth) { + NVRDataModel.debug ("setting basic auth with "+$scope.wizard.basicuser+":"+$scope.wizard.basicpassword); + cordova.plugin.http.useBasicAuth($scope.wizard.basicuser, $scope.wizard.basicpassword); + + } + + $http({ method: 'POST', |
