fix: Stop displaying sensitive info in the settings page (#4724)

fix: Stop displaying sensitive info in the settings page
This commit is contained in:
Neil Lathwood
2016-10-09 18:48:10 +01:00
committed by Søren Rosiak
parent 856ad3041b
commit c71035bf1f

View File

@@ -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;
} }