diff options
Diffstat (limited to 'www')
| -rw-r--r-- | www/index.html | 2 | ||||
| -rw-r--r-- | www/js/WizardCtrl.js | 16 | ||||
| -rwxr-xr-x | www/js/app.js | 16 |
3 files changed, 25 insertions, 9 deletions
diff --git a/www/index.html b/www/index.html index 7aa77593..97db02aa 100644 --- a/www/index.html +++ b/www/index.html @@ -66,6 +66,8 @@ <script src="lib/ng-mfb/src/mfb-directive.js"></script> <script src="lib/angular-touch/angular-touch.min.js"></script> <script src="lib/holderjs/holder.min.js"></script> + <script src="lib/angular-cookies/angular-cookies.min.js"></script> + diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index fb76c64c..0852f4f6 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,19 +342,25 @@ 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 - NVRDataModel.debug ("Clearing cookies"); - cordova.plugin.http.clearCookies(); + + 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"); cordova.plugin.http.useBasicAuth($scope.wizard.basicuser, $scope.wizard.basicpassword); } - } + $http({ diff --git a/www/js/app.js b/www/js/app.js index fd772197..993e5fff 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -28,7 +28,8 @@ angular.module('zmApp', [ 'uk.ac.soton.ecs.videogular.plugins.cuepoints', 'dcbImgFallback', 'ngImageAppear', - 'angular-websocket' + 'angular-websocket', + 'ngCookies' ]) @@ -860,7 +861,7 @@ angular.module('zmApp', [ // This service automatically logs into ZM at periodic intervals //------------------------------------------------------------------ - .factory('zmAutoLogin', function ($interval, NVRDataModel, $http, zm, $browser, $timeout, $q, $rootScope, $ionicLoading, $ionicPopup, $state, $ionicContentBanner, EventServer, $ionicHistory, $translate) { + .factory('zmAutoLogin', ['$interval', 'NVRDataModel', '$http', 'zm', '$timeout', '$q', '$rootScope', '$ionicLoading', '$ionicPopup', '$state', '$ionicContentBanner', 'EventServer', '$ionicHistory', '$translate', '$cookies',function ($interval, NVRDataModel, $http, zm, $timeout, $q, $rootScope, $ionicLoading, $ionicPopup, $state, $ionicContentBanner, EventServer, $ionicHistory, $translate, $cookies) { var zmAutoLoginHandle; //------------------------------------------------------------------ @@ -966,12 +967,19 @@ angular.module('zmApp', [ function doLogoutAndLogin(str) { + 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 - NVRDataModel.debug ("Clearing cookies"); + cordova.plugin.http.clearCookies(); } + else { + angular.forEach($cookies, function (v, k) { + $cookies.remove(k); + }); + } return NVRDataModel.logout() .then(function (ans) { return doLogin(str); @@ -1417,7 +1425,7 @@ angular.module('zmApp', [ stop: stop, doLogin: doLogoutAndLogin }; - }) + }]) //==================================================================== // First run in ionic |
