diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index b1f82031b6b..9ee8f3d2b91 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1980,7 +1980,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '';
// Date login validity
- print '
| '.$langs->trans("RangeOfLoginValidity").' | ';
+ print '
| '.$langs->trans("RangeOfLoginValidity").' | ';
print '';
if ($object->datestartvalidity) {
print ''.$langs->trans("FromDate").' ';
@@ -2043,9 +2043,9 @@ if ($action == 'create' || $action == 'adduserldap') {
// Other form for user password
$parameters = array('valuetoshow' => $valuetoshow, 'caneditpasswordandsee' => $permissiontoeditpasswordandsee, 'caneditpasswordandsend' => $permissiontoeditpasswordandsend);
$reshook = $hookmanager->executeHooks('printUserPasswordField', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
- if ($reshook > 0) {
+ if ($reshook === 1) {
$valuetoshow = $hookmanager->resPrint; // to replace
- } else {
+ } elseif (empty($reshook)) {
$valuetoshow .= $hookmanager->resPrint; // to add
}
@@ -2057,6 +2057,11 @@ if ($action == 'create' || $action == 'adduserldap') {
print ' |
'."\n";
}
+ // for compatibility with externals modules
+ if ($reshook > 1) {
+ print $hookmanager->resPrint;
+ }
+
// API key
if (isModEnabled('api') && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) {
print '| '.$langs->trans("ApiKey").' | ';