diff --git a/UI/WebServerResources/js/Common/SOGoAuthentication.js b/UI/WebServerResources/js/Common/SOGoAuthentication.js index 7f28d6201..2ced2fd6f 100644 --- a/UI/WebServerResources/js/Common/SOGoAuthentication.js +++ b/UI/WebServerResources/js/Common/SOGoAuthentication.js @@ -79,10 +79,14 @@ } else { newAddress = baseAddress; } + if (/theme=mobile/.test(window.location.search)) { - return baseAddress + '/Contacts' + '?theme=mobile'; + newAddress = baseAddress + '/Contacts' + '?theme=mobile'; } - return newAddress.replace(/(Calendar|Mail)/, 'Contacts'); + else { + newAddress = baseAddress + '/Contacts'; + } + return newAddress; }; diff --git a/UI/WebServerResources/js/ContactsUI.js b/UI/WebServerResources/js/ContactsUI.js index ebbf53a33..698bb7189 100644 --- a/UI/WebServerResources/js/ContactsUI.js +++ b/UI/WebServerResources/js/ContactsUI.js @@ -9,7 +9,7 @@ angular.module('SOGo.Contacts', ['ngSanitize', 'ui.router', 'mm.foundation', 'mm.foundation.offcanvas', 'SOGo.Common']) .constant('sgSettings', { - 'baseURL': '/SOGo/so/francis/Contacts' + 'baseURL': ApplicationBaseURL }) .config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { diff --git a/UI/WebServerResources/js/mobile/ContactsUI.js b/UI/WebServerResources/js/mobile/ContactsUI.js index 00a234fe5..972f8a030 100644 --- a/UI/WebServerResources/js/mobile/ContactsUI.js +++ b/UI/WebServerResources/js/mobile/ContactsUI.js @@ -9,7 +9,7 @@ angular.module('SOGo.Contacts', ['ionic', 'SOGo.Common', 'SOGo.Contacts']) .constant('sgSettings', { - 'baseURL': '/SOGo/so/francis/Contacts' + 'baseURL': ApplicationBaseURL }) .run(function($ionicPlatform) { diff --git a/UI/WebServerResources/js/mobile/SOGoRootPage.js b/UI/WebServerResources/js/mobile/SOGoRootPage.js index f52ff9d19..67b855d19 100644 --- a/UI/WebServerResources/js/mobile/SOGoRootPage.js +++ b/UI/WebServerResources/js/mobile/SOGoRootPage.js @@ -7,7 +7,7 @@ angular.module('SOGo.RootPage', ['SOGo.Authentication', 'SOGo.UIMobile', 'ionic']) .constant('sgSettings', { - 'baseURL': '/SOGo/so/francis/' + 'baseURL': ApplicationBaseURL }) .run(function($ionicPlatform) { @@ -48,9 +48,9 @@ $urlRouterProvider.otherwise('/app/login'); }) - .controller('AppCtrl', function($scope) { - $scope.ApplicationBaseURL = ApplicationBaseURL; - }) + .controller('AppCtrl', ['$scope', 'sgSettings', function(Settings, $scope) { + $scope.ApplicationBaseURL = Settings.baseURL; + }]) .controller('LoginCtrl', ['$scope', 'Authentication', 'sgDialog', function($scope, Authentication, Dialog) { $scope.creds = { 'username': null, 'password': null };