Skip to content

Commit

Permalink
Merge pull request #1648 from it-novum/ITC-3139
Browse files Browse the repository at this point in the history
ITC-3139 MSSQL wizard logs password to changelog: hide custom variab…
  • Loading branch information
nook24 authored Feb 22, 2024
2 parents 792b01a + 26ed727 commit 62e9a51
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/Model/Table/ChangelogsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function getCompareRules() {
'CheckPeriod' => '{(id|name)}',
'NotifyPeriod' => '{(id|name)}',
'CheckCommand' => '{(id|name)}',
'Hosttemplate.customvariables' => '{n}.{(id|name|value)}',
'Hosttemplate.customvariables' => '{n}.{(id|name|value|password)}',
'Hosttemplate.hosttemplatecommandargumentvalues' => '{n}.{(id|value)}',
'Contact' => '{n}.{(id|name)}',
'Contactgroup' => '{n}.{(id|name)}',
Expand All @@ -266,7 +266,7 @@ public function getCompareRules() {
'NotifyPeriod' => '{(id|name)}',
'CheckCommand' => '{(id|name)}',
'EventhandlerCommand' => '{(id|name)}',
'Servicetemplate.customvariables' => '{n}.{(id|name|value)}',
'Servicetemplate.customvariables' => '{n}.{(id|name|value|password)}',
'Servicetemplate.servicetemplatecommandargumentvalues' => '{n}.{(id|value)}',
'Servicetemplate.servicetemplateeventcommandargumentvalues' => '{n}.{(id|value)}',
'Contact' => '{n}.{(id|name)}',
Expand All @@ -292,7 +292,7 @@ public function getCompareRules() {
'CheckCommand' => '{(id|name)}',
'Hostgroup' => '{n}.{(id|name)}',
'Parenthost' => '{n}.{(id|name)}',
'Host.customvariables' => '{n}.{(id|name|value)}',
'Host.customvariables' => '{n}.{(id|name|value|password)}',
'Host.hostcommandargumentvalues' => '{n}.{(id|value)}',
'Contact' => '{n}.{(id|name)}',
'Contactgroup' => '{n}.{(id|name)}',
Expand All @@ -305,7 +305,7 @@ public function getCompareRules() {
'NotifyPeriod' => '{(id|name)}',
'CheckCommand' => '{(id|name)}',
'Servicegroup' => '{n}.{(id|name)}',
'Service.customvariables' => '{n}.{(id|name|value)}',
'Service.customvariables' => '{n}.{(id|name|value|password)}',
'Service.servicecommandargumentvalues' => '{n}.{(id|value)}',
'Service.serviceeventcommandargumentvalues' => '{n}.{(id|value)}',
'Contact' => '{n}.{(id|name)}',
Expand Down Expand Up @@ -871,13 +871,23 @@ public function formatDataForView(array $dataUnserialized, string $action): arra
}
}
}
if ($isArray) {
if (!empty(Hash::extract($diffs, '{n}.old[password=1].value'))) {
$diffs = Hash::insert($diffs, '{n}.old[password=1].value', '🤫');
}
if (!empty(Hash::extract($diffs, '{n}.new[password=1].value'))) {
$diffs = Hash::insert($diffs, '{n}.new[password=1].value', '🤫');
}
}

$dataUnserialized[$index][$tableName] = [
'data' => $diffs,
'isArray' => $isArray
];
}
}
}
$dataUnserialized = Hash::insert($dataUnserialized, '{n}.{s}.data.{n}[password=1].value', '🤫');
return $dataUnserialized;
}
}

0 comments on commit 62e9a51

Please sign in to comment.