FIX remove specific hook return

This commit is contained in:
Regis Houssin 2025-01-10 23:34:45 +01:00
parent 6e4f603c7c
commit 62c543ef17

View File

@ -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 '</tr>'."\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 '<tr class="nooddeven"><td>'.$langs->trans("ApiKey").'</td>';