From dcc950f7debaf1e223c79f18b0d62c32b25bcebd Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 3 Feb 2022 18:50:04 -0800 Subject: [PATCH] Added option to disable mobile site. --- meshcentral-config-schema.json | 1 + webserver.js | 1 + 2 files changed, 2 insertions(+) diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index d796b42a..19570517 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -299,6 +299,7 @@ "titlePicture": { "type": "string", "default": null, "description": "Web site .png logo file that is 450x66 in size placed in meshcentral-data that is used on the top of many pages." }, "loginPicture": { "type": "string", "default": null, "description": "Web site .png logo file placed in meshcentral-data that used on the login page when sitestyle is 2." }, "rootRedirect": { "type": "string", "default": null, "description": "Redirects HTTP root requests to this URL. When in use, direct users to /login to see the normal login page." }, + "mobileSite": { "type": "boolean", "default": true, "description": "When set to false, this setting will disable the mobile site." }, "unknownUserRootRedirect": { "type": "string", "default": null, "description": "Redirects HTTP root requests to this URL only where user is not already logged in. When in use, direct users to /login to see the normal login page." }, "userQuota": { "type": "integer" }, "meshQuota": { "type": "integer" }, diff --git a/webserver.js b/webserver.js index 441065ff..482fe56d 100644 --- a/webserver.js +++ b/webserver.js @@ -7440,6 +7440,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF var mobile = isMobileBrowser(req), minify = (domain.minify == true), p; if (req.query.mobile == '1') { mobile = true; } else if (req.query.mobile == '0') { mobile = false; } if (req.query.minify == '1') { minify = true; } else if (req.query.minify == '0') { minify = false; } + if ((domain != null) && (domain.mobilesite === false)) { mobile = false; } if (mobile) { if ((domain != null) && (domain.webviewspath != null)) { // If the domain has a web views path, use that first if (minify) {