mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix: Stop displaying sensitive info in the settings page (#4724)
fix: Stop displaying sensitive info in the settings page
This commit is contained in:
committed by
Søren Rosiak
parent
856ad3041b
commit
c71035bf1f
@@ -80,14 +80,24 @@ if (is_admin() === true) {
|
|||||||
|
|
||||||
function a2t($a)
|
function a2t($a)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$excluded = array(
|
||||||
|
'db_pass',
|
||||||
|
'email_smtp_password',
|
||||||
|
'password',
|
||||||
|
'auth_ad_bindpassword',
|
||||||
|
);
|
||||||
|
|
||||||
$r = '<table class="table table-condensed table-hover"><tbody>';
|
$r = '<table class="table table-condensed table-hover"><tbody>';
|
||||||
foreach ($a as $k => $v) {
|
foreach ($a as $k => $v) {
|
||||||
if (!empty($v)) {
|
if (!empty($v)) {
|
||||||
|
if (!in_array($k, $excluded)) {
|
||||||
$r .= '<tr><td class="col-md-2"><i><b>' . $k . '</b></i></td><td class="col-md-10">';
|
$r .= '<tr><td class="col-md-2"><i><b>' . $k . '</b></i></td><td class="col-md-10">';
|
||||||
$r .= is_array($v) ? a2t($v) : '<code>' . wordwrap($v, 75, '<br/>') . '</code>';
|
$r .= is_array($v) ? a2t($v) : '<code>' . wordwrap($v, 75, '<br/>') . '</code>';
|
||||||
$r .= '</td></tr>';
|
$r .= '</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$r .= '</tbody></table>';
|
$r .= '</tbody></table>';
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user