MOBILE-3163 core: Remove Classic app warning
parent
56678099e0
commit
9196371f50
|
@ -1556,7 +1556,7 @@
|
||||||
"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.checksiteversion": "Check that your site uses Moodle 2.4 or later.",
|
"core.login.checksiteversion": "Check that your site uses Moodle 3.1 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!",
|
||||||
"core.login.connecttomoodle": "Connect to Moodle",
|
"core.login.connecttomoodle": "Connect to Moodle",
|
||||||
|
@ -1585,15 +1585,12 @@
|
||||||
"core.login.invalidaccount": "Please check your login details or ask your site administrator to check the site configuration.",
|
"core.login.invalidaccount": "Please check your login details or ask your site administrator to check the site configuration.",
|
||||||
"core.login.invaliddate": "Invalid date",
|
"core.login.invaliddate": "Invalid date",
|
||||||
"core.login.invalidemail": "Invalid email address",
|
"core.login.invalidemail": "Invalid email address",
|
||||||
"core.login.invalidmoodleversion": "Invalid Moodle version. The minimum version required is 2.4.",
|
"core.login.invalidmoodleversion": "Invalid Moodle version. The minimum version required is 3.1.",
|
||||||
"core.login.invalidsite": "The site URL is invalid.",
|
"core.login.invalidsite": "The site URL is invalid.",
|
||||||
"core.login.invalidtime": "Invalid time",
|
"core.login.invalidtime": "Invalid time",
|
||||||
"core.login.invalidurl": "Invalid URL specified",
|
"core.login.invalidurl": "Invalid URL specified",
|
||||||
"core.login.invalidvaluemax": "The maximum value is {{$a}}",
|
"core.login.invalidvaluemax": "The maximum value is {{$a}}",
|
||||||
"core.login.invalidvaluemin": "The minimum value is {{$a}}",
|
"core.login.invalidvaluemin": "The minimum value is {{$a}}",
|
||||||
"core.login.legacymoodleversion": "You are trying to connect to an unsupported Moodle version. Please download the Moodle Classic app to access this Moodle site.",
|
|
||||||
"core.login.legacymoodleversiondesktop": "You are trying to connect to <b>{{$a}}</b>.<br><br>This site is running an outdated unsupported version of Moodle which will not work with this Moodle Desktop App.<br><br>If this is your site please contact your local moodle partner to get assistance to update it.<br><br>See <a href=\"https://moodle.com/contact\">our contact page</a> to submit a request for assistance.",
|
|
||||||
"core.login.legacymoodleversiondesktopdownloadold": "<br><br>Alternatively, you can still access this site using an unsupported version of the app that can be downloaded from here.",
|
|
||||||
"core.login.localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
|
"core.login.localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
|
||||||
"core.login.loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
|
"core.login.loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
|
||||||
"core.login.login": "Log in",
|
"core.login.login": "Log in",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"auth_email": "Email-based self-registration",
|
"auth_email": "Email-based self-registration",
|
||||||
"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 3.1 or later.",
|
||||||
"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",
|
||||||
|
@ -31,15 +31,12 @@
|
||||||
"invalidaccount": "Please check your login details or ask your site administrator to check the site configuration.",
|
"invalidaccount": "Please check your login details or ask your site administrator to check the site configuration.",
|
||||||
"invaliddate": "Invalid date",
|
"invaliddate": "Invalid date",
|
||||||
"invalidemail": "Invalid email address",
|
"invalidemail": "Invalid email address",
|
||||||
"invalidmoodleversion": "Invalid Moodle version. The minimum version required is 2.4.",
|
"invalidmoodleversion": "Invalid Moodle version. The minimum version required is 3.1.",
|
||||||
"invalidsite": "The site URL is invalid.",
|
"invalidsite": "The site URL is invalid.",
|
||||||
"invalidtime": "Invalid time",
|
"invalidtime": "Invalid time",
|
||||||
"invalidurl": "Invalid URL specified",
|
"invalidurl": "Invalid URL specified",
|
||||||
"invalidvaluemax": "The maximum value is {{$a}}",
|
"invalidvaluemax": "The maximum value is {{$a}}",
|
||||||
"invalidvaluemin": "The minimum value is {{$a}}",
|
"invalidvaluemin": "The minimum value is {{$a}}",
|
||||||
"legacymoodleversion": "You are trying to connect to an unsupported Moodle version. Please download the Moodle Classic app to access this Moodle site.",
|
|
||||||
"legacymoodleversiondesktop": "You are trying to connect to <b>{{$a}}</b>.<br><br>This site is running an outdated unsupported version of Moodle which will not work with this Moodle Desktop App.<br><br>If this is your site please contact your local moodle partner to get assistance to update it.<br><br>See <a href=\"https://moodle.com/contact\">our contact page</a> to submit a request for assistance.",
|
|
||||||
"legacymoodleversiondesktopdownloadold": "<br><br>Alternatively, you can still access this site using an unsupported version of the app that can be downloaded from here.",
|
|
||||||
"localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
|
"localmobileunexpectedresponse": "Moodle Mobile Additional Features check returned an unexpected response. You will be authenticated using the standard mobile service.",
|
||||||
"loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
|
"loggedoutssodescription": "You have to authenticate again. You need to log in to the site in a browser window.",
|
||||||
"login": "Log in",
|
"login": "Log in",
|
||||||
|
|
|
@ -1023,28 +1023,6 @@ export class CoreLoginHelperProvider {
|
||||||
(!CoreConfigConstants.skipssoconfirmation || String(CoreConfigConstants.skipssoconfirmation) === 'false');
|
(!CoreConfigConstants.skipssoconfirmation || String(CoreConfigConstants.skipssoconfirmation) === 'false');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Show a modal warning the user that he should use the Classic app.
|
|
||||||
*
|
|
||||||
* @param {string} message The warning message.
|
|
||||||
*/
|
|
||||||
protected showLegacyNoticeModal(message: string): void {
|
|
||||||
let link;
|
|
||||||
|
|
||||||
if (this.appProvider.isWindows()) {
|
|
||||||
link = 'https://download.moodle.org/desktop/download.php?platform=windows&version=342';
|
|
||||||
} else if (this.appProvider.isLinux()) {
|
|
||||||
link = 'https://download.moodle.org/desktop/download.php?platform=linux&version=342&arch=' +
|
|
||||||
(this.appProvider.is64Bits() ? '64' : '32');
|
|
||||||
} else if (this.platform.is('android')) {
|
|
||||||
link = 'market://details?id=com.moodle.classic';
|
|
||||||
} else if (this.platform.is('ios')) {
|
|
||||||
link = 'itms-apps://itunes.apple.com/app/id1403448117';
|
|
||||||
}
|
|
||||||
|
|
||||||
this.showDownloadAppNoticeModal(message, link);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show a modal warning the user that he should use the Workplace app.
|
* Show a modal warning the user that he should use the Workplace app.
|
||||||
*
|
*
|
||||||
|
@ -1225,8 +1203,6 @@ export class CoreLoginHelperProvider {
|
||||||
this.openChangePassword(siteUrl, this.textUtils.getErrorMessageFromError(error));
|
this.openChangePassword(siteUrl, this.textUtils.getErrorMessageFromError(error));
|
||||||
} else if (error.errorcode == 'usernotconfirmed') {
|
} else if (error.errorcode == 'usernotconfirmed') {
|
||||||
this.showNotConfirmedModal(siteUrl, undefined, username, password);
|
this.showNotConfirmedModal(siteUrl, undefined, username, password);
|
||||||
} else if (error.errorcode == 'legacymoodleversion') {
|
|
||||||
this.showLegacyNoticeModal(this.textUtils.getErrorMessageFromError(error));
|
|
||||||
} else if (error.errorcode == 'connecttomoodleapp') {
|
} else if (error.errorcode == 'connecttomoodleapp') {
|
||||||
this.showMoodleAppNoticeModal(this.textUtils.getErrorMessageFromError(error));
|
this.showMoodleAppNoticeModal(this.textUtils.getErrorMessageFromError(error));
|
||||||
} else if (error.errorcode == 'connecttoworkplaceapp') {
|
} else if (error.errorcode == 'connecttoworkplaceapp') {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
"areyousure": "Are you sure?",
|
"areyousure": "Are you sure?",
|
||||||
"back": "Back",
|
"back": "Back",
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"cannotconnect": "Cannot connect: Verify that you have correctly typed the URL and that your site uses Moodle 2.4 or later.",
|
"cannotconnect": "Cannot connect: Verify that you have correctly typed the URL and that your site uses Moodle 3.1 or later.",
|
||||||
"cannotdownloadfiles": "File downloading is disabled. Please contact your site administrator.",
|
"cannotdownloadfiles": "File downloading is disabled. Please contact your site administrator.",
|
||||||
"captureaudio": "Record audio",
|
"captureaudio": "Record audio",
|
||||||
"capturedimage": "Taken picture.",
|
"capturedimage": "Taken picture.",
|
||||||
|
|
|
@ -247,7 +247,6 @@ export class CoreSitesProvider {
|
||||||
protected WORKPLACE_APP = 3;
|
protected WORKPLACE_APP = 3;
|
||||||
protected MOODLE_APP = 2;
|
protected MOODLE_APP = 2;
|
||||||
protected VALID_VERSION = 1;
|
protected VALID_VERSION = 1;
|
||||||
protected LEGACY_APP_VERSION = 0;
|
|
||||||
protected INVALID_VERSION = -1;
|
protected INVALID_VERSION = -1;
|
||||||
|
|
||||||
protected isWPApp: boolean;
|
protected isWPApp: boolean;
|
||||||
|
@ -690,25 +689,9 @@ export class CoreSitesProvider {
|
||||||
*/
|
*/
|
||||||
protected treatInvalidAppVersion(result: number, siteUrl: string, siteId?: string): Promise<any> {
|
protected treatInvalidAppVersion(result: number, siteUrl: string, siteId?: string): Promise<any> {
|
||||||
let errorCode,
|
let errorCode,
|
||||||
errorKey,
|
errorKey;
|
||||||
errorExtra = '',
|
|
||||||
errorKeyParams;
|
|
||||||
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case this.LEGACY_APP_VERSION:
|
|
||||||
errorKey = 'core.login.legacymoodleversion';
|
|
||||||
errorCode = 'legacymoodleversion';
|
|
||||||
|
|
||||||
if (this.appProvider.isDesktop()) {
|
|
||||||
errorKey += 'desktop';
|
|
||||||
errorKeyParams = {$a: siteUrl};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.appProvider.isWindows() || this.appProvider.isLinux()) {
|
|
||||||
errorExtra = this.translate.instant('core.login.legacymoodleversiondesktopdownloadold');
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case this.MOODLE_APP:
|
case this.MOODLE_APP:
|
||||||
errorKey = 'core.login.connecttomoodleapp';
|
errorKey = 'core.login.connecttomoodleapp';
|
||||||
errorCode = 'connecttomoodleapp';
|
errorCode = 'connecttomoodleapp';
|
||||||
|
@ -732,7 +715,7 @@ export class CoreSitesProvider {
|
||||||
|
|
||||||
return promise.then(() => {
|
return promise.then(() => {
|
||||||
return Promise.reject({
|
return Promise.reject({
|
||||||
error: this.translate.instant(errorKey, errorKeyParams) + errorExtra,
|
error: this.translate.instant(errorKey),
|
||||||
errorcode: errorCode,
|
errorcode: errorCode,
|
||||||
loggedout: true
|
loggedout: true
|
||||||
});
|
});
|
||||||
|
@ -779,16 +762,14 @@ export class CoreSitesProvider {
|
||||||
* Check for the minimum required version.
|
* Check for the minimum required version.
|
||||||
*
|
*
|
||||||
* @param {any} info Site info.
|
* @param {any} info Site info.
|
||||||
* @return {number} Either VALID_VERSION, LEGACY_APP_VERSION, WORKPLACE_APP, MOODLE_APP or INVALID_VERSION.
|
* @return {number} Either VALID_VERSION, WORKPLACE_APP, MOODLE_APP or INVALID_VERSION.
|
||||||
*/
|
*/
|
||||||
protected isValidMoodleVersion(info: any): number {
|
protected isValidMoodleVersion(info: any): number {
|
||||||
if (!info) {
|
if (!info) {
|
||||||
return this.INVALID_VERSION;
|
return this.INVALID_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const version24 = 2012120300, // Moodle 2.4 version.
|
const version31 = 2016052300,
|
||||||
release24 = '2.4',
|
|
||||||
version31 = 2016052300,
|
|
||||||
release31 = '3.1';
|
release31 = '3.1';
|
||||||
|
|
||||||
// Try to validate by version.
|
// Try to validate by version.
|
||||||
|
@ -797,8 +778,6 @@ export class CoreSitesProvider {
|
||||||
if (!isNaN(version)) {
|
if (!isNaN(version)) {
|
||||||
if (version >= version31) {
|
if (version >= version31) {
|
||||||
return this.validateWorkplaceVersion(info);
|
return this.validateWorkplaceVersion(info);
|
||||||
} else if (version >= version24) {
|
|
||||||
return this.LEGACY_APP_VERSION;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -809,9 +788,6 @@ export class CoreSitesProvider {
|
||||||
if (release >= release31) {
|
if (release >= release31) {
|
||||||
return this.validateWorkplaceVersion(info);
|
return this.validateWorkplaceVersion(info);
|
||||||
}
|
}
|
||||||
if (release >= release24) {
|
|
||||||
return this.LEGACY_APP_VERSION;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Couldn't validate it.
|
// Couldn't validate it.
|
||||||
|
@ -1556,9 +1532,10 @@ export class CoreSitesProvider {
|
||||||
*
|
*
|
||||||
* @param {any} info The site info.
|
* @param {any} info The site info.
|
||||||
* @return {boolean} Whether it's a legacy Moodle.
|
* @return {boolean} Whether it's a legacy Moodle.
|
||||||
|
* @deprecated since 3.7.1
|
||||||
*/
|
*/
|
||||||
isLegacyMoodleByInfo(info: any): boolean {
|
isLegacyMoodleByInfo(info: any): boolean {
|
||||||
return this.isValidMoodleVersion(info) == this.LEGACY_APP_VERSION;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue