Fixed adding unknown user to device group.

This commit is contained in:
Ylian Saint-Hilaire 2019-05-08 15:15:34 -07:00
parent 0591fb60a8
commit 8df9d02675
8 changed files with 16 additions and 8 deletions

View File

@ -1361,7 +1361,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
// Check if the user exists // Check if the user exists
var newuserid = 'user/' + domain.id + '/' + command.username.toLowerCase(), newuser = parent.users[newuserid]; var newuserid = 'user/' + domain.id + '/' + command.username.toLowerCase(), newuser = parent.users[newuserid];
if (newuser == null) { if (newuser == null) {
// TODO: Send error back, user not found. // Send error back, user not found.
displayNotificationMessage('User "' + EscapeHtml(command.username) + '" not found.', 'Device Group', 'ServerNotify');
break; break;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "meshcentral", "name": "meshcentral",
"version": "0.3.3-u", "version": "0.3.3-w",
"keywords": [ "keywords": [
"Remote Management", "Remote Management",
"Intel AMT", "Intel AMT",

View File

@ -315,7 +315,8 @@ body {
} }
#welcomeimage { #welcomeimage {
text-align: right; text-align: center;
width:50%;
} }
@media (max-width: 800px) { @media (max-width: 800px) {
@ -331,6 +332,7 @@ body {
#logincell { #logincell {
text-align: center; text-align: center;
width:50%;
} }
#loginpanel, #createpanel, #resetpanel, #tokenpanel, #resettokenpanel, #resetpasswordpanel, #resetpasswordpanel { #loginpanel, #createpanel, #resetpanel, #tokenpanel, #resettokenpanel, #resetpasswordpanel, #resetpasswordpanel {

File diff suppressed because one or more lines are too long

View File

@ -6270,7 +6270,9 @@
function p20showAddMeshUserDialog() { function p20showAddMeshUserDialog() {
if (xxdialogMode) return; if (xxdialogMode) return;
var x = "Allow a user to manage this device group and devices in this group<br /><br />"; var x = "Allow a user to manage this device group and devices in this group.";
if (features & 0x00080000) { x += " Users need to login to this server once before they can be added to a device group." }
x += "<br /><br />";
x += addHtmlValue('User Name', '<input id=dp20username style=width:230px maxlength=32 onchange=p20validateAddMeshUserDialog() onkeyup=p20validateAddMeshUserDialog() />'); x += addHtmlValue('User Name', '<input id=dp20username style=width:230px maxlength=32 onchange=p20validateAddMeshUserDialog() onkeyup=p20validateAddMeshUserDialog() />');
x += '<br><div style="height:120px;overflow-y:scroll;border:1px solid gray">'; x += '<br><div style="height:120px;overflow-y:scroll;border:1px solid gray">';
x += '<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20fulladmin>Full Administrator<br>'; x += '<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20fulladmin>Full Administrator<br>';
@ -7379,7 +7381,9 @@
if (node != null) { icon = node.icon; t = '<b>' + node.name + '</b>: ' } if (node != null) { icon = node.icon; t = '<b>' + node.name + '</b>: ' }
} }
r += '<div title="Occured at ' + d.toLocaleString() + '" id="notifyx' + n.id + '" class=notification style="cursor:pointer;border-top:1px solid ' + ((r == '')?'transparent':'orange') + '"><div class=j' + icon + ' onclick="notificationSelected(' + n.id + ')" style=margin:5px;float:left></div><div onclick="notificationDelete(' + n.id + ')" class=unselectable title="Clear this notification" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected(' + n.id + ')" style=margin:5px>' + t + n.text + '</div></div>'; r += '<div title="Occured at ' + d.toLocaleString() + '" id="notifyx' + n.id + '" class=notification style="cursor:pointer;border-top:1px solid ' + ((r == '') ? 'transparent' : 'orange') + '">';
if (icon) { r += '<div class=j' + icon + ' onclick="notificationSelected(' + n.id + ')" style=margin:5px;float:left></div>'; }
r += '<div onclick="notificationDelete(' + n.id + ')" class=unselectable title="Clear this notification" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected(' + n.id + ')" style=margin:5px>' + t + n.text + '</div></div>';
} }
} }
var deleteall = ''; var deleteall = '';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1336,6 +1336,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if ((domain.passwordrequirements != null) && (domain.passwordrequirements.hint === true)) { features += 0x00010000; } // Enable password hints if ((domain.passwordrequirements != null) && (domain.passwordrequirements.hint === true)) { features += 0x00010000; } // Enable password hints
if ((parent.config.settings.no2factorauth !== true) && (obj.f2l != null)) { features += 0x00020000; } // Enable WebAuthn/FIDO2 support if ((parent.config.settings.no2factorauth !== true) && (obj.f2l != null)) { features += 0x00020000; } // Enable WebAuthn/FIDO2 support
if ((obj.args.nousers != true) && (domain.passwordrequirements != null) && (domain.passwordrequirements.force2factor === true)) { features += 0x00040000; } // Force 2-factor auth if ((obj.args.nousers != true) && (domain.passwordrequirements != null) && (domain.passwordrequirements.force2factor === true)) { features += 0x00040000; } // Force 2-factor auth
if ((domain.auth == 'sspi') || (domain.auth == 'ldap')) { features += 0x00080000; } // LDAP or SSPI in use, warn that users must login first before adding a user to a group.
// Create a authentication cookie // Create a authentication cookie
const authCookie = obj.parent.encodeCookie({ userid: user._id, domainid: domain.id }, obj.parent.loginCookieEncryptionKey); const authCookie = obj.parent.encodeCookie({ userid: user._id, domainid: domain.id }, obj.parent.loginCookieEncryptionKey);