Don't log the user password in case something goes wrong
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
1c4a1b8807
commit
366df29340
|
@ -41,18 +41,28 @@ class Action {
|
||||||
* @param string $text
|
* @param string $text
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* @param array $elements
|
* @param array $elements
|
||||||
|
* @param bool $obfuscateParameters
|
||||||
*/
|
*/
|
||||||
public function log($text,
|
public function log($text,
|
||||||
array $params,
|
array $params,
|
||||||
array $elements) {
|
array $elements,
|
||||||
|
$obfuscateParameters = false) {
|
||||||
foreach($elements as $element) {
|
foreach($elements as $element) {
|
||||||
if(!isset($params[$element])) {
|
if(!isset($params[$element])) {
|
||||||
$this->logger->critical(
|
if ($obfuscateParameters) {
|
||||||
sprintf(
|
$this->logger->critical(
|
||||||
'$params["'.$element.'"] was missing. Transferred value: %s',
|
'$params["'.$element.'"] was missing.',
|
||||||
print_r($params, true)
|
['app' => 'admin_audit']
|
||||||
)
|
);
|
||||||
);
|
} else {
|
||||||
|
$this->logger->critical(
|
||||||
|
sprintf(
|
||||||
|
'$params["'.$element.'"] was missing. Transferred value: %s',
|
||||||
|
print_r($params, true)
|
||||||
|
),
|
||||||
|
['app' => 'admin_audit']
|
||||||
|
);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,8 @@ class Auth extends Action {
|
||||||
$params,
|
$params,
|
||||||
[
|
[
|
||||||
'uid',
|
'uid',
|
||||||
]
|
],
|
||||||
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +45,8 @@ class Auth extends Action {
|
||||||
$params,
|
$params,
|
||||||
[
|
[
|
||||||
'uid',
|
'uid',
|
||||||
]
|
],
|
||||||
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue