Added LoginFooter option.

Ylian Saint-Hilaire committed Dec 21, 2020 at 23:32 UTC 3dc616151ac1a9b459387d1dc571bfd236d8c2b3
3 files changed +4 -2
meshcentral-config-schema.json
+2 -1
@@ -174,7 +174,8 @@
174 "welcomeText": { "type": "string", "description": "Text that will be shown on the login screen." },
175 "welcomePicture": { "type": "string", "description": "Name of the PNG or JPEG file that will be shown on the login screen. Put this file in the meshcentral-data folder and place the file name here." },
176 "hide": { "type": "integer", "default": 0 },
177 - "footer": { "type": "string", "default": null },
177 + "footer": { "type": "string", "default": null, "description": "This is a HTML string displayed at the bottom of the web page when a user is logged in." },
178 + "loginfooter": { "type": "string", "default": null "description": "This is a HTML string displayed at the bottom of the web page when a user is not logged in." },
179 "certUrl": {
180 "type": "string",
181 "format": "uri",
sample-config-advanced.json
+1
@@ -139,6 +139,7 @@
139 "___hide__": "Sum of: 1 = Hide header, 2 = Hide tab, 4 = Hide footer, 8 = Hide title, 16 = Hide left bar",
140 "_hide": 4,
141 "_footer": "<a href='https://twitter.com/mytwitter'>Twitter</a>",
142 + "_loginfooter": "This is a private server.",
143 "_certUrl": "https://192.168.2.106:443/",
144 "myServer": {
145 "Backup": false,
webserver.js
+1 -1
@@ -2554,7 +2554,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2554 if (domain.customui != null) { customui = encodeURIComponent(JSON.stringify(domain.customui)); }
2555
2556 // Render the login page
2557 - render(req, res, getRenderPage((domain.sitestyle == 2) ? 'login2' : 'login', req, domain), getRenderArgs({ loginmode: loginmode, rootCertLink: getRootCertLink(), newAccount: newAccountsAllowed, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: obj.getWebServerName(domain), serverPublicPort: httpsPort, passlogin: (typeof domain.showpasswordlogin == 'boolean') ? domain.showpasswordlogin : true, emailcheck: emailcheck, features: features, sessiontime: args.sessiontime, passRequirements: passRequirements, customui: customui, footer: (domain.footer == null) ? '' : domain.footer, hkey: encodeURIComponent(hardwareKeyChallenge).replace(/'/g, '%27'), messageid: msgid, passhint: passhint, welcometext: domain.welcometext ? encodeURIComponent(domain.welcometext).split('\'').join('\\\'') : null, hwstate: hwstate, otpemail: otpemail, otpsms: otpsms, twoFactorCookieDays: twoFactorCookieDays, authStrategies: authStrategies.join(','), loginpicture: (typeof domain.loginpicture == 'string') }, req, domain, (domain.sitestyle == 2) ? 'login2' : 'login'));
2557 + render(req, res, getRenderPage((domain.sitestyle == 2) ? 'login2' : 'login', req, domain), getRenderArgs({ loginmode: loginmode, rootCertLink: getRootCertLink(), newAccount: newAccountsAllowed, newAccountPass: (((domain.newaccountspass == null) || (domain.newaccountspass == '')) ? 0 : 1), serverDnsName: obj.getWebServerName(domain), serverPublicPort: httpsPort, passlogin: (typeof domain.showpasswordlogin == 'boolean') ? domain.showpasswordlogin : true, emailcheck: emailcheck, features: features, sessiontime: args.sessiontime, passRequirements: passRequirements, customui: customui, footer: (domain.loginfooter == null) ? '' : domain.loginfooter, hkey: encodeURIComponent(hardwareKeyChallenge).replace(/'/g, '%27'), messageid: msgid, passhint: passhint, welcometext: domain.welcometext ? encodeURIComponent(domain.welcometext).split('\'').join('\\\'') : null, hwstate: hwstate, otpemail: otpemail, otpsms: otpsms, twoFactorCookieDays: twoFactorCookieDays, authStrategies: authStrategies.join(','), loginpicture: (typeof domain.loginpicture == 'string') }, req, domain, (domain.sitestyle == 2) ? 'login2' : 'login'));
2558 }
2559
2560 // Handle a post request on the root