Fixed login picture.

Ylian Saint-Hilaire committed Sep 8, 2020 at 11:44 UTC 2d2e7001c1e2f094a0ea88443e46ba9ae291126b
1 file changed +6 -3
webserver.js
+6 -3
@@ -2459,7 +2459,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2459 if (domain.customui != null) { customui = encodeURIComponent(JSON.stringify(domain.customui)); }
2460
2461 // Render the login page
2462 - 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, 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));
2462 + 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, 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'));
2463 }
2464
2465 // Handle a post request on the root
@@ -5978,13 +5978,16 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
5978 }
5979
5980 // Return the correct render page arguments.
5981 - function getRenderArgs(xargs, req, domain) {
5981 + function getRenderArgs(xargs, req, domain, page) {
5982 var minify = (domain.minify == true);
5983 if (req.query.minify == '1') { minify = true; } else if (req.query.minify == '0') { minify = false; }
5984 xargs.min = minify ? '-min' : '';
5985 xargs.titlehtml = domain.titlehtml;
5986 xargs.title = (domain.title != null) ? domain.title : 'MeshCentral';
5987 - if ((domain.titlepicture == null) && (domain.titlehtml == null)) {
5987 + if (
5988 + ((page == 'login2') && (domain.loginpicture == null) && (domain.titlehtml == null)) ||
5989 + ((page != 'login2') && (domain.titlepicture == null) && (domain.titlehtml == null))
5990 + ) {
5991 if (domain.title == null) {
5992 xargs.title1 = 'MeshCentral';
5993 xargs.title2 = '';