mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added fetching previous Intel AMT activation passwords into table.
This commit is contained in:
parent
d7bf871bca
commit
85ef5fca26
4 changed files with 60 additions and 1 deletions
|
@ -131,6 +131,22 @@ module.exports.CertificateOperations = function (parent) {
|
|||
// Log the Intel AMT activation operation in the domain log
|
||||
obj.logAmtActivation = function (domain, x) {
|
||||
if (x == null) return true;
|
||||
|
||||
// Add the password to the Intel AMT list of UUID to passwords
|
||||
if ((typeof x.amtUuid == 'string') && (typeof x.password == 'string')) {
|
||||
if (parent.amtPasswords == null) { parent.amtPasswords = {}; }
|
||||
if (parent.amtPasswords[x.amtUuid] == null) {
|
||||
parent.amtPasswords[x.amtUuid] = [x.password]; // Add password to array
|
||||
parent.amtPasswords = parent.common.sortObj(parent.amtPasswords);
|
||||
} else {
|
||||
if (parent.amtPasswords[x.amtUuid].indexOf(x.password) == -1) {
|
||||
parent.amtPasswords[x.amtUuid].unshift(x.password); // Add password at the start of the array
|
||||
while (parent.amtPasswords[x.amtUuid].length > 3) { parent.amtPasswords[x.amtUuid].pop(); } // Only keep the 3 last passwords for any given device
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Append to the log file
|
||||
var logpath = null;
|
||||
if ((domain.amtacmactivation == null) || (domain.amtacmactivation.log == null) || (typeof domain.amtacmactivation.log != 'string')) {
|
||||
if (domain.id == '') { logpath = parent.path.join(obj.parent.datapath, 'amtactivation.log'); } else { logpath = parent.path.join(obj.parent.datapath, 'amtactivation-' + domain.id + '.log'); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue