mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-24 06:05:53 -05:00
Input validation fix
This commit is contained in:
parent
069da0d9a8
commit
4c8a66c9d1
@ -617,7 +617,8 @@ function CreateMeshCentralServer(config, args) {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (obj.args.adminaccount || (obj.args.resetaccount.startsWith('user/') == false)) {
|
||||
if (obj.args.adminaccount) {
|
||||
if (obj.args.resetaccount.startsWith('user/') == false) { console.log('Invalid userid, usage: --adminaccount [userid].'); process.exit(); return; }
|
||||
obj.db.Get(obj.args.adminaccount, function (err, docs) {
|
||||
if ((err != null) || (docs == null) || (docs.length == 0)) { console.log('Unknown userid, usage: --adminaccount [userid].'); process.exit(); return; }
|
||||
docs[0].siteadmin = 0xFFFFFFFF; // Set user as site administrator
|
||||
|
Loading…
Reference in New Issue
Block a user