From 8554dcd388bba44d6957da8b27bc6f3de70629b3 Mon Sep 17 00:00:00 2001 From: dpalou Date: Wed, 3 Oct 2018 13:17:26 +0200 Subject: [PATCH] MOBILE-1075 settings: Allow accessing settings from login pages --- src/core/login/pages/credentials/credentials.html | 6 ++++++ src/core/login/pages/credentials/credentials.ts | 4 +++- src/core/login/pages/site/site.html | 3 +++ src/core/login/pages/sites/sites.html | 3 +++ src/core/settings/pages/about/about.ts | 4 ++-- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/core/login/pages/credentials/credentials.html b/src/core/login/pages/credentials/credentials.html index fbde4964c..4adb68666 100644 --- a/src/core/login/pages/credentials/credentials.html +++ b/src/core/login/pages/credentials/credentials.html @@ -1,6 +1,12 @@ {{ 'core.login.login' | translate }} + + + + diff --git a/src/core/login/pages/credentials/credentials.ts b/src/core/login/pages/credentials/credentials.ts index b80ee030e..11c32714a 100644 --- a/src/core/login/pages/credentials/credentials.ts +++ b/src/core/login/pages/credentials/credentials.ts @@ -44,6 +44,7 @@ export class CoreLoginCredentialsPage { identityProviders: any[]; pageLoaded = false; isBrowserSSO = false; + isFixedUrlSet = false; protected siteConfig; protected eventThrown = false; @@ -72,8 +73,9 @@ export class CoreLoginCredentialsPage { */ ionViewDidLoad(): void { this.treatSiteConfig(); + this.isFixedUrlSet = this.loginHelper.isFixedUrlSet(); - if (this.loginHelper.isFixedUrlSet()) { + if (this.isFixedUrlSet) { // Fixed URL, we need to check if it uses browser SSO login. this.checkSite(this.siteUrl); } else { diff --git a/src/core/login/pages/site/site.html b/src/core/login/pages/site/site.html index 737e6ef89..ff637b8a8 100644 --- a/src/core/login/pages/site/site.html +++ b/src/core/login/pages/site/site.html @@ -3,6 +3,9 @@ {{ 'core.login.connecttomoodle' | translate }} + diff --git a/src/core/login/pages/sites/sites.html b/src/core/login/pages/sites/sites.html index b1d283c18..1de888148 100644 --- a/src/core/login/pages/sites/sites.html +++ b/src/core/login/pages/sites/sites.html @@ -3,6 +3,9 @@ {{ 'core.settings.sites' | translate }} + diff --git a/src/core/settings/pages/about/about.ts b/src/core/settings/pages/about/about.ts index 95c126a1a..1e4310362 100644 --- a/src/core/settings/pages/about/about.ts +++ b/src/core/settings/pages/about/about.ts @@ -67,8 +67,8 @@ export class CoreSettingsAboutPage { this.lastCommit = CoreConfigConstants.lastcommit; // Calculate the privacy policy to use. - this.privacyPolicy = currentSite.getStoredConfig('tool_mobile_apppolicy') || currentSite.getStoredConfig('sitepolicy') || - CoreConfigConstants.privacypolicy; + this.privacyPolicy = (currentSite && (currentSite.getStoredConfig('tool_mobile_apppolicy') || + currentSite.getStoredConfig('sitepolicy'))) || CoreConfigConstants.privacypolicy; this.navigator = window.navigator; if (window.location && window.location.href) {