Skip to content

Commit

Permalink
FIX remove specific hook return
Browse files Browse the repository at this point in the history
  • Loading branch information
hregis committed Jan 10, 2025
1 parent 6e4f603 commit 62c543e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions htdocs/user/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2043,9 +2043,9 @@
// 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
}

Expand All @@ -2057,11 +2057,6 @@
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>';
Expand Down

0 comments on commit 62c543e

Please sign in to comment.