From 62c543ef1782c7d26ae91785ddea1e3f75c54eda Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 10 Jan 2025 23:34:45 +0100 Subject: [PATCH] FIX remove specific hook return --- htdocs/user/card.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/user/card.php b/htdocs/user/card.php index e2992a25f46..d535cc0ddc6 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -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 === 1) { + if ($reshook > 0) { $valuetoshow = $hookmanager->resPrint; // to replace - } elseif (empty($reshook)) { + } else { $valuetoshow .= $hookmanager->resPrint; // to add } @@ -2057,11 +2057,6 @@ 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").'';