diff --git a/dev/App/Abstract.jsx b/dev/App/Abstract.jsx index a942f83b7..e9ae5dc31 100644 --- a/dev/App/Abstract.jsx +++ b/dev/App/Abstract.jsx @@ -229,10 +229,7 @@ class AbstractApp extends AbstractBoot */ loginAndLogoutReload(admin = false, logout = false, close = false) { - const - mobile = Settings.appSettingsGet('mobile'), - inIframe = !!Settings.appSettingsGet('inIframe'); - + const inIframe = !!Settings.appSettingsGet('inIframe'); let customLogoutLink = pString(Settings.appSettingsGet('customLogoutLink')); if (logout) @@ -245,7 +242,7 @@ class AbstractApp extends AbstractBoot window.close(); } - customLogoutLink = customLogoutLink || (admin ? Links.rootAdmin(mobile) : Links.rootUser(mobile)); + customLogoutLink = customLogoutLink || (admin ? Links.rootAdmin() : Links.rootUser()); if (logout && window.location.href !== customLogoutLink) { diff --git a/dev/Common/Links.jsx b/dev/Common/Links.jsx index e0a639bf3..fb421824e 100644 --- a/dev/Common/Links.jsx +++ b/dev/Common/Links.jsx @@ -10,6 +10,7 @@ const SUB_QUERY_PREFIX = '&q[]=', VERSION = Settings.appSettingsGet('version'), + IS_MOBILE = Settings.appSettingsGet('mobile'), WEB_PREFIX = Settings.appSettingsGet('webPath') || '', VERSION_PREFIX = Settings.appSettingsGet('webVersionPath') || 'rainloop/v/' + VERSION + '/', @@ -54,12 +55,11 @@ export function rootAdmin() } /** - * @param {boolean=} mobile = false * @returns {string} */ -export function rootUser(mobile = false) +export function rootUser() { - return mobile ? SERVER_PREFIX + '/Mobile/' : ROOT; + return IS_MOBILE ? SERVER_PREFIX + '/Mobile/' : ROOT; } /** @@ -171,7 +171,7 @@ export function append() */ export function change(email) { - return serverRequest('Change') + encodeURIComponent(email) + '/'; + return serverRequest('Change' + (IS_MOBILE ? 'Mobile' : '')) + encodeURIComponent(email) + '/'; } /** diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index e87d5560b..29e2c4d4c 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -1155,10 +1155,7 @@ class ServiceActions return $sResult; } - /** - * @return string - */ - public function ServiceChange() + private function changeAction() { $this->oHttp->ServerNoCache(); @@ -1184,7 +1181,24 @@ class ServiceActions $this->oActions->AuthToken($oAccountToLogin); } } + } + /** + * @return string + */ + public function ServiceChangeMobile() + { + $this->changeAction(); + $this->oActions->Location('./?/Mobile/'); + return ''; + } + + /** + * @return string + */ + public function ServiceChange() + { + $this->changeAction(); $this->oActions->Location('./'); return ''; }