diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 8142ab323a1..60d898a064d 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2020 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2018 Regis Houssin * Copyright (C) 2005 Lionel Cousteix @@ -1434,7 +1434,7 @@ if ($action == 'create' || $action == 'adduserldap') { if ($object->pass) $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass); else { - if ($user->admin) $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").': '.$object->pass_indatabase_crypted; else $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').''.$langs->trans("Hidden").''; } } @@ -1453,7 +1453,7 @@ if ($action == 'create' || $action == 'adduserldap') if (!empty($conf->api->enabled) && $user->admin) { print ''.$langs->trans("ApiKey").''; print ''; - if (!empty($object->api_key)) print preg_replace('/./', '*', $object->api_key); + if (!empty($object->api_key)) print ''.preg_replace('/./', '*', $object->api_key).''; print ''; }