commit
						9a0b960d3a
					
				| @ -146,7 +146,7 @@ | |||||||
|     <plugin name="cordova-plugin-statusbar" spec="^2.4.3" /> |     <plugin name="cordova-plugin-statusbar" spec="^2.4.3" /> | ||||||
|     <plugin name="cordova-plugin-whitelist" spec="^1.3.4" /> |     <plugin name="cordova-plugin-whitelist" spec="^1.3.4" /> | ||||||
|     <plugin name="cordova-plugin-zip" spec="^3.1.0" /> |     <plugin name="cordova-plugin-zip" spec="^3.1.0" /> | ||||||
|     <plugin name="cordova-sqlite-storage" spec="^2.6.0" /> |     <plugin name="cordova-sqlite-storage" spec="^3.4.0" /> | ||||||
|     <plugin name="nl.kingsquare.cordova.background-audio" spec="^1.0.1" /> |     <plugin name="nl.kingsquare.cordova.background-audio" spec="^1.0.1" /> | ||||||
|     <plugin name="phonegap-plugin-push" spec="https://github.com/moodlemobile/phonegap-plugin-push.git#moodle-v3"> |     <plugin name="phonegap-plugin-push" spec="https://github.com/moodlemobile/phonegap-plugin-push.git#moodle-v3"> | ||||||
|         <variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" /> |         <variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" /> | ||||||
|  | |||||||
							
								
								
									
										6673
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6673
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -82,7 +82,7 @@ | |||||||
|     "ajv": "^6.10.2", |     "ajv": "^6.10.2", | ||||||
|     "chart.js": "^2.7.2", |     "chart.js": "^2.7.2", | ||||||
|     "com-darryncampbell-cordova-plugin-intent": "^1.1.7", |     "com-darryncampbell-cordova-plugin-intent": "^1.1.7", | ||||||
|     "cordova": "8.1.2", |     "cordova": "9.0.0", | ||||||
|     "cordova-android": "8.0.0", |     "cordova-android": "8.0.0", | ||||||
|     "cordova-android-support-gradle-release": "^3.0.1", |     "cordova-android-support-gradle-release": "^3.0.1", | ||||||
|     "cordova-clipboard": "^1.3.0", |     "cordova-clipboard": "^1.3.0", | ||||||
| @ -106,7 +106,7 @@ | |||||||
|     "cordova-plugin-statusbar": "^2.4.3", |     "cordova-plugin-statusbar": "^2.4.3", | ||||||
|     "cordova-plugin-whitelist": "^1.3.4", |     "cordova-plugin-whitelist": "^1.3.4", | ||||||
|     "cordova-plugin-zip": "^3.1.0", |     "cordova-plugin-zip": "^3.1.0", | ||||||
|     "cordova-sqlite-storage": "^2.6.0", |     "cordova-sqlite-storage": "^3.4.0", | ||||||
|     "cordova-support-google-services": "^1.2.1", |     "cordova-support-google-services": "^1.2.1", | ||||||
|     "es6-promise-plugin": "^4.2.2", |     "es6-promise-plugin": "^4.2.2", | ||||||
|     "font-awesome": "^4.7.0", |     "font-awesome": "^4.7.0", | ||||||
|  | |||||||
| @ -1564,6 +1564,12 @@ | |||||||
|   "core.login.auth_email": "auth_email/pluginname", |   "core.login.auth_email": "auth_email/pluginname", | ||||||
|   "core.login.authenticating": "local_moodlemobileapp", |   "core.login.authenticating": "local_moodlemobileapp", | ||||||
|   "core.login.cancel": "moodle", |   "core.login.cancel": "moodle", | ||||||
|  |   "core.login.changepassword": "moodle", | ||||||
|  |   "core.login.changepasswordbutton": "local_moodlemobileapp", | ||||||
|  |   "core.login.changepasswordhelp": "local_moodlemobileapp", | ||||||
|  |   "core.login.changepassowrdinstructions": "local_moodlemobileapp", | ||||||
|  |   "core.login.changepasswordlogoutinstructions": "local_moodlemobileapp", | ||||||
|  |   "core.login.changepasswordreconnectinstructions": "local_moodlemobileapp", | ||||||
|   "core.login.checksiteversion": "local_moodlemobileapp", |   "core.login.checksiteversion": "local_moodlemobileapp", | ||||||
|   "core.login.confirmdeletesite": "local_moodlemobileapp", |   "core.login.confirmdeletesite": "local_moodlemobileapp", | ||||||
|   "core.login.connect": "local_moodlemobileapp", |   "core.login.connect": "local_moodlemobileapp", | ||||||
| @ -1585,6 +1591,7 @@ | |||||||
|   "core.login.errorupdatesite": "local_moodlemobileapp", |   "core.login.errorupdatesite": "local_moodlemobileapp", | ||||||
|   "core.login.findyoursite": "local_moodlemobileapp", |   "core.login.findyoursite": "local_moodlemobileapp", | ||||||
|   "core.login.firsttime": "moodle", |   "core.login.firsttime": "moodle", | ||||||
|  |   "core.login.forcepasswordchangenotice": "moodle", | ||||||
|   "core.login.forgotten": "moodle", |   "core.login.forgotten": "moodle", | ||||||
|   "core.login.getanothercaptcha": "auth", |   "core.login.getanothercaptcha": "auth", | ||||||
|   "core.login.help": "moodle", |   "core.login.help": "moodle", | ||||||
|  | |||||||
| @ -99,7 +99,7 @@ export class MoodleMobileApp implements OnInit { | |||||||
| 
 | 
 | ||||||
|         // Listen for passwordchange and usernotfullysetup events to open InAppBrowser.
 |         // Listen for passwordchange and usernotfullysetup events to open InAppBrowser.
 | ||||||
|         this.eventsProvider.on(CoreEventsProvider.PASSWORD_CHANGE_FORCED, (data) => { |         this.eventsProvider.on(CoreEventsProvider.PASSWORD_CHANGE_FORCED, (data) => { | ||||||
|             this.loginHelper.openInAppForEdit(data.siteId, '/login/change_password.php', 'core.forcepasswordchangenotice', true); |             this.loginHelper.passwordChangeForced(data.siteId); | ||||||
|         }); |         }); | ||||||
|         this.eventsProvider.on(CoreEventsProvider.USER_NOT_FULLY_SETUP, (data) => { |         this.eventsProvider.on(CoreEventsProvider.USER_NOT_FULLY_SETUP, (data) => { | ||||||
|             this.loginHelper.openInAppForEdit(data.siteId, '/user/edit.php', 'core.usernotfullysetup'); |             this.loginHelper.openInAppForEdit(data.siteId, '/user/edit.php', 'core.usernotfullysetup'); | ||||||
|  | |||||||
| @ -1562,6 +1562,12 @@ | |||||||
|     "core.login.auth_email": "Email-based self-registration", |     "core.login.auth_email": "Email-based self-registration", | ||||||
|     "core.login.authenticating": "Authenticating", |     "core.login.authenticating": "Authenticating", | ||||||
|     "core.login.cancel": "Cancel", |     "core.login.cancel": "Cancel", | ||||||
|  |     "core.login.changepassowrdinstructions": "You cannot change your password in the app. Please click the following button to open the site in a web browser to change your password. Take into account you need to close the browser after changing the password as you will not be redirected to the app.", | ||||||
|  |     "core.login.changepassword": "Change password", | ||||||
|  |     "core.login.changepasswordbutton": "Open the change password page", | ||||||
|  |     "core.login.changepasswordhelp": "If you have problems changing your password, please contact your site administrator. \"Site Administrators\" are the people who manages the Moodle at your school/university/company or learning organisation. If you don't know how to contact them, please contact your teachers/trainers.", | ||||||
|  |     "core.login.changepasswordlogoutinstructions": "If you prefer to change site or log out, please click the following button:", | ||||||
|  |     "core.login.changepasswordreconnectinstructions": "Click the following button to reconnect to the site. (Take into account that if you didn't change your password successfully, you would return to the previous screen).", | ||||||
|     "core.login.checksiteversion": "Check that your site uses Moodle 2.4 or later.", |     "core.login.checksiteversion": "Check that your site uses Moodle 2.4 or later.", | ||||||
|     "core.login.confirmdeletesite": "Are you sure you want to delete the site {{sitename}}?", |     "core.login.confirmdeletesite": "Are you sure you want to delete the site {{sitename}}?", | ||||||
|     "core.login.connect": "Connect!", |     "core.login.connect": "Connect!", | ||||||
| @ -1583,6 +1589,7 @@ | |||||||
|     "core.login.errorupdatesite": "An error occurred while updating the site's token.", |     "core.login.errorupdatesite": "An error occurred while updating the site's token.", | ||||||
|     "core.login.findyoursite": "Find your site", |     "core.login.findyoursite": "Find your site", | ||||||
|     "core.login.firsttime": "Is this your first time here?", |     "core.login.firsttime": "Is this your first time here?", | ||||||
|  |     "core.login.forcepasswordchangenotice": "You must change your password to proceed.", | ||||||
|     "core.login.forgotten": "Forgotten your username or password?", |     "core.login.forgotten": "Forgotten your username or password?", | ||||||
|     "core.login.getanothercaptcha": "Get another CAPTCHA", |     "core.login.getanothercaptcha": "Get another CAPTCHA", | ||||||
|     "core.login.help": "Help", |     "core.login.help": "Help", | ||||||
|  | |||||||
| @ -3,6 +3,12 @@ | |||||||
|     "authenticating": "Authenticating", |     "authenticating": "Authenticating", | ||||||
|     "cancel": "Cancel", |     "cancel": "Cancel", | ||||||
|     "checksiteversion": "Check that your site uses Moodle 2.4 or later.", |     "checksiteversion": "Check that your site uses Moodle 2.4 or later.", | ||||||
|  |     "changepassword": "Change password", | ||||||
|  |     "changepasswordbutton": "Open the change password page", | ||||||
|  |     "changepasswordhelp": "If you have problems changing your password, please contact your site administrator. \"Site Administrators\" are the people who manages the Moodle at your school/university/company or learning organisation. If you don't know how to contact them, please contact your teachers/trainers.", | ||||||
|  |     "changepassowrdinstructions": "You cannot change your password in the app. Please click the following button to open the site in a web browser to change your password. Take into account you need to close the browser after changing the password as you will not be redirected to the app.", | ||||||
|  |     "changepasswordlogoutinstructions": "If you prefer to change site or log out, please click the following button:", | ||||||
|  |     "changepasswordreconnectinstructions": "Click the following button to reconnect to the site. (Take into account that if you didn't change your password successfully, you would return to the previous screen).", | ||||||
|     "confirmdeletesite": "Are you sure you want to delete the site {{sitename}}?", |     "confirmdeletesite": "Are you sure you want to delete the site {{sitename}}?", | ||||||
|     "connect": "Connect!", |     "connect": "Connect!", | ||||||
|     "connecttomoodle": "Connect to Moodle", |     "connecttomoodle": "Connect to Moodle", | ||||||
| @ -23,6 +29,7 @@ | |||||||
|     "errorupdatesite": "An error occurred while updating the site's token.", |     "errorupdatesite": "An error occurred while updating the site's token.", | ||||||
|     "findyoursite": "Find your site", |     "findyoursite": "Find your site", | ||||||
|     "firsttime": "Is this your first time here?", |     "firsttime": "Is this your first time here?", | ||||||
|  |     "forcepasswordchangenotice": "You must change your password to proceed.", | ||||||
|     "forgotten": "Forgotten your username or password?", |     "forgotten": "Forgotten your username or password?", | ||||||
|     "getanothercaptcha": "Get another CAPTCHA", |     "getanothercaptcha": "Get another CAPTCHA", | ||||||
|     "help": "Help", |     "help": "Help", | ||||||
|  | |||||||
							
								
								
									
										27
									
								
								src/core/login/pages/change-password/change-password.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								src/core/login/pages/change-password/change-password.html
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | |||||||
|  | <ion-header> | ||||||
|  |     <ion-navbar core-back-button> | ||||||
|  |         <ion-title>{{ 'core.login.changepassword' | translate }}</ion-title> | ||||||
|  |         <ion-buttons end> | ||||||
|  |             <button ion-button icon-only (click)="showHelp()" [attr.aria-label]="'core.help' | translate"> | ||||||
|  |                 <ion-icon name="help-circle"></ion-icon> | ||||||
|  |             </button> | ||||||
|  |         </ion-buttons> | ||||||
|  |     </ion-navbar> | ||||||
|  | </ion-header> | ||||||
|  | <ion-content padding class="core-center-view"> | ||||||
|  |     <ion-list> | ||||||
|  |         <ion-item text-wrap *ngIf="!changingPassword"> | ||||||
|  |             <h2>{{ 'core.login.forcepasswordchangenotice' | translate }}</h2> | ||||||
|  |             <p padding-vertical>{{ 'core.login.changepassowrdinstructions' | translate }}</p> | ||||||
|  |             <button text-wrap ion-button block (click)="openChangePasswordPage()">{{ 'core.login.changepasswordbutton' | translate }}</button> | ||||||
|  |         </ion-item> | ||||||
|  |         <ion-item text-wrap *ngIf="changingPassword"> | ||||||
|  |             <p padding-bottom>{{ 'core.login.changepasswordreconnectinstructions' | translate }}</p> | ||||||
|  |             <button text-wrap ion-button block (click)="login()">{{ 'core.login.reconnect' | translate }}</button> | ||||||
|  |         </ion-item> | ||||||
|  |         <ion-item text-wrap> | ||||||
|  |             <p padding-bottom>{{ 'core.login.changepasswordlogoutinstructions' | translate }}</p> | ||||||
|  |             <button text-wrap ion-button block color="light" (click)="logout()">{{ logoutLabel | translate }}</button> | ||||||
|  |         </ion-item> | ||||||
|  |     </ion-list> | ||||||
|  | </ion-content> | ||||||
| @ -0,0 +1,33 @@ | |||||||
|  | // (C) Copyright 2015 Moodle Pty Ltd.
 | ||||||
|  | //
 | ||||||
|  | // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||||
|  | // you may not use this file except in compliance with the License.
 | ||||||
|  | // You may obtain a copy of the License at
 | ||||||
|  | //
 | ||||||
|  | //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||||
|  | //
 | ||||||
|  | // Unless required by applicable law or agreed to in writing, software
 | ||||||
|  | // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||||
|  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||||
|  | // See the License for the specific language governing permissions and
 | ||||||
|  | // limitations under the License.
 | ||||||
|  | 
 | ||||||
|  | import { NgModule } from '@angular/core'; | ||||||
|  | import { IonicPageModule } from 'ionic-angular'; | ||||||
|  | import { TranslateModule } from '@ngx-translate/core'; | ||||||
|  | import { CoreLoginChangePasswordPage } from './change-password'; | ||||||
|  | import { CoreComponentsModule } from '@components/components.module'; | ||||||
|  | import { CoreDirectivesModule } from '@directives/directives.module'; | ||||||
|  | 
 | ||||||
|  | @NgModule({ | ||||||
|  |     declarations: [ | ||||||
|  |         CoreLoginChangePasswordPage | ||||||
|  |     ], | ||||||
|  |     imports: [ | ||||||
|  |         CoreComponentsModule, | ||||||
|  |         CoreDirectivesModule, | ||||||
|  |         IonicPageModule.forChild(CoreLoginChangePasswordPage), | ||||||
|  |         TranslateModule.forChild() | ||||||
|  |     ] | ||||||
|  | }) | ||||||
|  | export class CoreLoginChangePasswordPageModule {} | ||||||
							
								
								
									
										69
									
								
								src/core/login/pages/change-password/change-password.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										69
									
								
								src/core/login/pages/change-password/change-password.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,69 @@ | |||||||
|  | // (C) Copyright 2015 Moodle Pty Ltd.
 | ||||||
|  | //
 | ||||||
|  | // Licensed under the Apache License, Version 2.0 (the "License");
 | ||||||
|  | // you may not use this file except in compliance with the License.
 | ||||||
|  | // You may obtain a copy of the License at
 | ||||||
|  | //
 | ||||||
|  | //     http://www.apache.org/licenses/LICENSE-2.0
 | ||||||
|  | //
 | ||||||
|  | // Unless required by applicable law or agreed to in writing, software
 | ||||||
|  | // distributed under the License is distributed on an "AS IS" BASIS,
 | ||||||
|  | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | ||||||
|  | // See the License for the specific language governing permissions and
 | ||||||
|  | // limitations under the License.
 | ||||||
|  | 
 | ||||||
|  | import { Component } from '@angular/core'; | ||||||
|  | import { IonicPage } from 'ionic-angular'; | ||||||
|  | import { TranslateService } from '@ngx-translate/core'; | ||||||
|  | import { CoreSitesProvider } from '@providers/sites'; | ||||||
|  | import { CoreLoginHelperProvider } from '../../providers/helper'; | ||||||
|  | import { CoreDomUtilsProvider } from '@providers/utils/dom'; | ||||||
|  | 
 | ||||||
|  | /** | ||||||
|  |  * Page that shows instructions to change the password. | ||||||
|  |  */ | ||||||
|  | @IonicPage({ segment: 'core-login-change-password' }) | ||||||
|  | @Component({ | ||||||
|  |     selector: 'page-core-change-password', | ||||||
|  |     templateUrl: 'change-password.html', | ||||||
|  | }) | ||||||
|  | export class CoreLoginChangePasswordPage { | ||||||
|  |     changingPassword = false; | ||||||
|  |     logoutLabel: string; | ||||||
|  | 
 | ||||||
|  |     constructor(private translate: TranslateService, private sitesProvider: CoreSitesProvider, | ||||||
|  |             private loginHelper: CoreLoginHelperProvider, private domUtls: CoreDomUtilsProvider) { | ||||||
|  |         this.logoutLabel = this.loginHelper.getLogoutLabel(); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Show a help modal. | ||||||
|  |      */ | ||||||
|  |     showHelp(): void { | ||||||
|  |         this.domUtls.showAlert(this.translate.instant('core.help'), this.translate.instant('core.login.changepasswordhelp')); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Open the change password page in a browser. | ||||||
|  |      */ | ||||||
|  |     openChangePasswordPage(): void { | ||||||
|  |         this.loginHelper.openInAppForEdit(this.sitesProvider.getCurrentSiteId(), '/login/change_password.php', undefined, true); | ||||||
|  |         this.changingPassword = true; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Login the user. | ||||||
|  |      */ | ||||||
|  |     login(): void { | ||||||
|  |         this.loginHelper.goToSiteInitialPage(); | ||||||
|  |         this.changingPassword = false; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     /** | ||||||
|  |      * Logout the user. | ||||||
|  |      */ | ||||||
|  |     logout(): void { | ||||||
|  |         this.sitesProvider.logout(); | ||||||
|  |         this.changingPassword = false; | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -32,6 +32,7 @@ import { CoreCourseProvider } from '@core/course/providers/course'; | |||||||
| import { CoreConfigConstants } from '../../../configconstants'; | import { CoreConfigConstants } from '../../../configconstants'; | ||||||
| import { CoreConstants } from '@core/constants'; | import { CoreConstants } from '@core/constants'; | ||||||
| import { Md5 } from 'ts-md5/dist/md5'; | import { Md5 } from 'ts-md5/dist/md5'; | ||||||
|  | import { CoreSite } from '@classes/site'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Data related to a SSO authentication. |  * Data related to a SSO authentication. | ||||||
| @ -367,6 +368,19 @@ export class CoreLoginHelperProvider { | |||||||
|         return errors; |         return errors; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * Returns the logout label of a site. | ||||||
|  |      * | ||||||
|  |      * @param site Site. If not defined, use current site. | ||||||
|  |      * @return The string key. | ||||||
|  |      */ | ||||||
|  |     getLogoutLabel(site?: CoreSite): string { | ||||||
|  |         site = site || this.sitesProvider.getCurrentSite(); | ||||||
|  |         const config = site.getStoredConfig(); | ||||||
|  | 
 | ||||||
|  |         return 'core.mainmenu.' + (config && config.tool_mobile_forcelogout == '1' ? 'logout' : 'changesite'); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Get the site policy. |      * Get the site policy. | ||||||
|      * |      * | ||||||
| @ -796,7 +810,7 @@ export class CoreLoginHelperProvider { | |||||||
|         this.utils.openInApp(siteUrl + '/login/forgot_password.php'); |         this.utils.openInApp(siteUrl + '/login/forgot_password.php'); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /* |     /** | ||||||
|      * Function to open in app browser to change password or complete user profile. |      * Function to open in app browser to change password or complete user profile. | ||||||
|      * |      * | ||||||
|      * @param siteId The site ID. |      * @param siteId The site ID. | ||||||
| @ -804,7 +818,7 @@ export class CoreLoginHelperProvider { | |||||||
|      * @param alertMessage The key of the message to display before opening the in app browser. |      * @param alertMessage The key of the message to display before opening the in app browser. | ||||||
|      * @param invalidateCache Whether to invalidate site's cache (e.g. when the user is forced to change password). |      * @param invalidateCache Whether to invalidate site's cache (e.g. when the user is forced to change password). | ||||||
|      */ |      */ | ||||||
|     openInAppForEdit(siteId: string, path: string, alertMessage: string, invalidateCache?: boolean): void { |     openInAppForEdit(siteId: string, path: string, alertMessage?: string, invalidateCache?: boolean): void { | ||||||
|         if (!siteId || siteId !== this.sitesProvider.getCurrentSiteId()) { |         if (!siteId || siteId !== this.sitesProvider.getCurrentSiteId()) { | ||||||
|             // Site that triggered the event is not current site, nothing to do.
 |             // Site that triggered the event is not current site, nothing to do.
 | ||||||
|             return; |             return; | ||||||
| @ -824,7 +838,9 @@ export class CoreLoginHelperProvider { | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             // Open change password.
 |             // Open change password.
 | ||||||
|  |             if (alertMessage) { | ||||||
|                 alertMessage = this.translate.instant(alertMessage) + '<br>' + this.translate.instant('core.redirectingtosite'); |                 alertMessage = this.translate.instant(alertMessage) + '<br>' + this.translate.instant('core.redirectingtosite'); | ||||||
|  |             } | ||||||
|             currentSite.openInAppWithAutoLogin(siteUrl + path, undefined, alertMessage).then(() => { |             currentSite.openInAppWithAutoLogin(siteUrl + path, undefined, alertMessage).then(() => { | ||||||
|                 this.waitingForBrowser = true; |                 this.waitingForBrowser = true; | ||||||
|             }).finally(() => { |             }).finally(() => { | ||||||
| @ -833,6 +849,28 @@ export class CoreLoginHelperProvider { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * Function that should be called when password change is forced. Reserved for core use. | ||||||
|  |      * | ||||||
|  |      * @param siteId The site ID. | ||||||
|  |      */ | ||||||
|  |     passwordChangeForced(siteId: string): void { | ||||||
|  |         const currentSite = this.sitesProvider.getCurrentSite(); | ||||||
|  |         if (!currentSite || siteId !== currentSite.getId()) { | ||||||
|  |             return; // Site that triggered the event is not current site.
 | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         const rootNavCtrl = this.appProvider.getRootNavController(), | ||||||
|  |         activePage = rootNavCtrl.getActive(); | ||||||
|  | 
 | ||||||
|  |         // If current page is already change password, stop.
 | ||||||
|  |         if (activePage && activePage.component && activePage.component.name == 'CoreLoginChangePasswordPage') { | ||||||
|  |             return; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         rootNavCtrl.setRoot('CoreLoginChangePasswordPage', {siteId}); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     /** |     /** | ||||||
|      * Prepare the app to perform SSO login. |      * Prepare the app to perform SSO login. | ||||||
|      * |      * | ||||||
|  | |||||||
| @ -18,6 +18,7 @@ import { CoreEventsProvider } from '@providers/events'; | |||||||
| import { CoreSitesProvider } from '@providers/sites'; | import { CoreSitesProvider } from '@providers/sites'; | ||||||
| import { CoreMainMenuDelegate, CoreMainMenuHandlerData } from '../../providers/delegate'; | import { CoreMainMenuDelegate, CoreMainMenuHandlerData } from '../../providers/delegate'; | ||||||
| import { CoreMainMenuProvider, CoreMainMenuCustomItem } from '../../providers/mainmenu'; | import { CoreMainMenuProvider, CoreMainMenuCustomItem } from '../../providers/mainmenu'; | ||||||
|  | import { CoreLoginHelperProvider } from '@core/login/providers/helper'; | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  * Page that displays the list of main menu options that aren't in the tabs. |  * Page that displays the list of main menu options that aren't in the tabs. | ||||||
| @ -46,7 +47,7 @@ export class CoreMainMenuMorePage implements OnDestroy { | |||||||
| 
 | 
 | ||||||
|     constructor(private menuDelegate: CoreMainMenuDelegate, private sitesProvider: CoreSitesProvider, |     constructor(private menuDelegate: CoreMainMenuDelegate, private sitesProvider: CoreSitesProvider, | ||||||
|             private navCtrl: NavController, private mainMenuProvider: CoreMainMenuProvider, |             private navCtrl: NavController, private mainMenuProvider: CoreMainMenuProvider, | ||||||
|             eventsProvider: CoreEventsProvider) { |             eventsProvider: CoreEventsProvider, private loginHelper: CoreLoginHelperProvider) { | ||||||
| 
 | 
 | ||||||
|         this.langObserver = eventsProvider.on(CoreEventsProvider.LANGUAGE_CHANGED, this.loadSiteInfo.bind(this)); |         this.langObserver = eventsProvider.on(CoreEventsProvider.LANGUAGE_CHANGED, this.loadSiteInfo.bind(this)); | ||||||
|         this.updateSiteObserver = eventsProvider.on(CoreEventsProvider.SITE_UPDATED, this.loadSiteInfo.bind(this), |         this.updateSiteObserver = eventsProvider.on(CoreEventsProvider.SITE_UPDATED, this.loadSiteInfo.bind(this), | ||||||
| @ -104,13 +105,12 @@ export class CoreMainMenuMorePage implements OnDestroy { | |||||||
|      * Load the site info required by the view. |      * Load the site info required by the view. | ||||||
|      */ |      */ | ||||||
|     protected loadSiteInfo(): void { |     protected loadSiteInfo(): void { | ||||||
|         const currentSite = this.sitesProvider.getCurrentSite(), |         const currentSite = this.sitesProvider.getCurrentSite(); | ||||||
|             config = currentSite.getStoredConfig(); |  | ||||||
| 
 | 
 | ||||||
|         this.siteInfo = currentSite.getInfo(); |         this.siteInfo = currentSite.getInfo(); | ||||||
|         this.siteName = currentSite.getSiteName(); |         this.siteName = currentSite.getSiteName(); | ||||||
|         this.siteUrl = currentSite.getURL(); |         this.siteUrl = currentSite.getURL(); | ||||||
|         this.logoutLabel = 'core.mainmenu.' + (config && config.tool_mobile_forcelogout == '1' ? 'logout' : 'changesite'); |         this.logoutLabel = this.loginHelper.getLogoutLabel(currentSite); | ||||||
|         this.showWeb = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_website'); |         this.showWeb = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_website'); | ||||||
|         this.showHelp = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_help'); |         this.showHelp = !currentSite.isFeatureDisabled('CoreMainMenuDelegate_help'); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user