mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-26 06:03:15 -05:00
Users with user management permission can now change all user's passwords except full admins.
This commit is contained in:
parent
3a61a77b8a
commit
e374d8a839
@ -1983,7 +1983,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
case 'changeuserpass':
|
case 'changeuserpass':
|
||||||
{
|
{
|
||||||
// Change a user's password
|
// Change a user's password
|
||||||
if (user.siteadmin != 0xFFFFFFFF) break;
|
if ((user.siteadmin & 2) == 0) break;
|
||||||
if (common.validateString(command.userid, 1, 256) == false) break;
|
if (common.validateString(command.userid, 1, 256) == false) break;
|
||||||
if (common.validateString(command.pass, 0, 256) == false) break;
|
if (common.validateString(command.pass, 0, 256) == false) break;
|
||||||
if ((command.hint != null) && (common.validateString(command.hint, 0, 256) == false)) break;
|
if ((command.hint != null) && (common.validateString(command.hint, 0, 256) == false)) break;
|
||||||
@ -1992,6 +1992,9 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
|||||||
|
|
||||||
var chguser = parent.users[command.userid];
|
var chguser = parent.users[command.userid];
|
||||||
if (chguser) {
|
if (chguser) {
|
||||||
|
// If we are not full administrator, we can't change anything on a different full administrator
|
||||||
|
if ((user.siteadmin != 0xFFFFFFFF) & (chguser.siteadmin == 0xFFFFFFFF)) break;
|
||||||
|
|
||||||
// Can only perform this operation on other users of our group.
|
// Can only perform this operation on other users of our group.
|
||||||
if ((user.groups != null) && (user.groups.length > 0) && ((chguser.groups == null) || (findOne(chguser.groups, user.groups) == false))) break;
|
if ((user.groups != null) && (user.groups.length > 0) && ((chguser.groups == null) || (findOne(chguser.groups, user.groups) == false))) break;
|
||||||
|
|
||||||
|
@ -10064,7 +10064,7 @@
|
|||||||
x = '<div style=float:right;font-size:x-small>';
|
x = '<div style=float:right;font-size:x-small>';
|
||||||
if (deletePossible) x += '<a href=# style=cursor:pointer onclick=\'return p30showDeleteUserDialog()\' title="Remove this user">' + "Delete User" + '</a>';
|
if (deletePossible) x += '<a href=# style=cursor:pointer onclick=\'return p30showDeleteUserDialog()\' title="Remove this user">' + "Delete User" + '</a>';
|
||||||
x += '</div><div style=font-size:x-small>';
|
x += '</div><div style=font-size:x-small>';
|
||||||
if (userinfo.siteadmin == 0xFFFFFFFF) x += '<a href=# style=cursor:pointer onclick=\'return p30showUserChangePassDialog(' + multiFactor + ')\' title="' + "Change the password for this user" + '">' + "Change Password" + '</a>';
|
if (((userinfo.siteadmin & 2) && (user.siteadmin != 0xFFFFFFFF)) || (userinfo.siteadmin == 0xFFFFFFFF)) x += '<a href=# style=cursor:pointer onclick=\'return p30showUserChangePassDialog(' + multiFactor + ')\' title="' + "Change the password for this user" + '">' + "Change Password" + '</a>';
|
||||||
x += '</div><br>'
|
x += '</div><br>'
|
||||||
QH('p30html3', x);
|
QH('p30html3', x);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user