From 6bcc1d65eb0d87c842ed3dc49770553066ec729d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 17 Sep 2020 15:28:16 +0200 Subject: [PATCH] Always hide hash --- htdocs/user/card.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 60d898a064d..d5c8fc4320e 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1434,7 +1434,12 @@ if ($action == 'create' || $action == 'adduserldap') { if ($object->pass) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); else { - if ($user->admin && $user->id == $object->id) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("Crypted").': '.$object->pass_indatabase_crypted; + if ($user->admin && $user->id == $object->id) { + $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("Crypted").': '; + print ''.$langs->trans("Hidden").''; + // TODO Add a feature to reveal the hash + print ''; + } else $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("Hidden").''; } } @@ -1454,6 +1459,9 @@ if ($action == 'create' || $action == 'adduserldap') print ''.$langs->trans("ApiKey").''; print ''; if (!empty($object->api_key)) print ''.preg_replace('/./', '*', $object->api_key).''; + if ($user->admin || $user->id == $object->id) { + // TODO Add a feature to reveal the hash + } print ''; }