mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-09-11 08:55:32 +03:00
More work on Intel AMT Click Once Recovery.
This commit is contained in:
parent
a3f85bd042
commit
1c47f13090
26
meshuser.js
26
meshuser.js
@ -5492,8 +5492,30 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'clickoncerecovery': {
|
||||
console.log(command); // TODO
|
||||
case 'clickoncerecovery': { // Intel(R) AMT Click once recovery
|
||||
if (common.validateStrArray(command.nodeids, 1) == false) break; // Check nodeids
|
||||
if (common.validateString(command.path, 1, 2048) == false) break; // Check file path
|
||||
if (command.type != 'diskimage') break; // Make sure type is correct
|
||||
|
||||
var file = parent.getServerFilePath(user, domain, command.path);
|
||||
if (file == null) return;
|
||||
|
||||
// For each nodeid, change the group
|
||||
for (var i = 0; i < command.nodeids.length; i++) {
|
||||
var xnodeid = command.nodeids[i];
|
||||
if (xnodeid.indexOf('/') == -1) { xnodeid = 'node/' + domain.id + '/' + xnodeid; }
|
||||
|
||||
// Get the node and the rights for this node
|
||||
parent.GetNodeWithRights(domain, user, xnodeid, function (node, rights, visible) {
|
||||
// Check if we found this device and if we have full rights
|
||||
if ((node == null) || (rights != 0xFFFFFFFF)) return;
|
||||
|
||||
// Perform Intel AMT Click Once Recovery
|
||||
console.log('ClickOnceRecovery', node._id, file.fullpath);
|
||||
});
|
||||
}
|
||||
|
||||
//console.log(command, file);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
@ -3438,7 +3438,10 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||
if ((node == null) || (rights != 0xFFFFFFFF) || (visible == false)) { res.sendStatus(404); return; } // We don't have remote control rights to this device
|
||||
for (var i in files.files) {
|
||||
var file = files.files[i];
|
||||
console.log('ClickOnceRecovery', file); // TODO
|
||||
|
||||
// Perform Intel AMT Click Once Recovery
|
||||
console.log('ClickOnceRecovery', node._id, file.path);
|
||||
|
||||
try { obj.fs.unlinkSync(file.path); } catch (e) { }
|
||||
}
|
||||
res.send('');
|
||||
|
Loading…
Reference in New Issue
Block a user