From dd118166576cc0cf94b2ceb05c339811549393d1 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 25 Mar 2022 11:13:47 -0700 Subject: [PATCH] Fixed server update feature when given rights but are not administrator. --- views/default.handlebars | 4 ++-- webserver.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/views/default.handlebars b/views/default.handlebars index 21b08179..8ae1fb4c 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2605,8 +2605,8 @@ if (!message.tags.latest) { message.tags.latest = "Unknown"; } x += addHtmlValue2("Current Version", '' + EscapeHtml(message.tags.current) + ''); x += '
'; - x += addHtmlValue2('', '' + EscapeHtml(message.tags.stable) + ''); - x += addHtmlValue2('', '' + EscapeHtml(message.tags.latest) + ''); + x += addHtmlValue2('', '' + EscapeHtml(message.tags.stable) + ''); + x += addHtmlValue2('', '' + EscapeHtml(message.tags.latest) + ''); x += ''; if (((message.tags.current == message.tags.latest) && (message.tags.current == message.tags.stable)) || ((features & 2048) == 0)) { setDialogMode(2, "MeshCentral Version", 1, null, x); diff --git a/webserver.js b/webserver.js index db629153..27133b4f 100644 --- a/webserver.js +++ b/webserver.js @@ -2902,7 +2902,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF // 0x00000100 --> This feature flag is free for future use. if (obj.args.allowhighqualitydesktop !== false) { features += 0x00000200; } // Enable AllowHighQualityDesktop (Default true) if ((obj.args.lanonly == true) || (obj.args.mpsport == 0)) { features += 0x00000400; } // No CIRA - if ((obj.parent.serverSelfWriteAllowed == true) && (user != null) && (user.siteadmin == 0xFFFFFFFF)) { features += 0x00000800; } // Server can self-write (Allows self-update) + if ((obj.parent.serverSelfWriteAllowed == true) && (user != null) && ((user.siteadmin & 0x00000010) != 0)) { features += 0x00000800; } // Server can self-write (Allows self-update) if ((parent.config.settings.no2factorauth !== true) && (domain.auth != 'sspi') && (obj.parent.certificates.CommonName.indexOf('.') != -1) && (obj.args.nousers !== true) && (user._id.split('/')[2][0] != '~')) { features += 0x00001000; } // 2FA login supported if (domain.agentnoproxy === true) { features += 0x00002000; } // Indicates that agents should be installed without using a HTTP proxy if ((parent.config.settings.no2factorauth !== true) && domain.yubikey && domain.yubikey.id && domain.yubikey.secret && (user._id.split('/')[2][0] != '~')) { features += 0x00004000; } // Indicates Yubikey support