diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3779e3ed6fa..9d9b73bad09 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1619,85 +1619,90 @@ else print '
'; - if (! empty($object->email)) + $parameters=array(); + $reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook)) { - $langs->load("mails"); - print '
'.$langs->trans('SendMail').'
'; - } - else - { - $langs->load("mails"); - print '
'.$langs->trans('SendMail').'
'; - } - - if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) + if (! empty($object->email)) { - print '
'.$langs->trans("Modify").'
'; + $langs->load("mails"); + print '
'.$langs->trans('SendMail').'
'; } else { - print '
'.$langs->trans("Modify").'
'; + $langs->load("mails"); + print '
'.$langs->trans('SendMail').'
'; } - } - elseif ($caneditpassword && ! $object->ldap_sid && - (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - print '
'.$langs->trans("EditPassword").'
'; - } - // Si on a un gestionnaire de generation de mot de passe actif - if ($conf->global->USER_PASSWORD_GENERATED != 'none') - { - if ($object->statut == 0) + if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print '
'.$langs->trans("ReinitPassword").'
'; + if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) + { + print '
'.$langs->trans("Modify").'
'; + } + else + { + print '
'.$langs->trans("Modify").'
'; + } } - elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + elseif ($caneditpassword && ! $object->ldap_sid && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) + { + print '
'.$langs->trans("EditPassword").'
'; + } + + // Si on a un gestionnaire de generation de mot de passe actif + if ($conf->global->USER_PASSWORD_GENERATED != 'none') + { + if ($object->statut == 0) + { + print '
'.$langs->trans("ReinitPassword").'
'; + } + elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) + { + print '
'.$langs->trans("ReinitPassword").'
'; + } + + if ($object->statut == 0) + { + print '
'.$langs->trans("SendNewPassword").'
'; + } + else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) + { + if ($object->email) print '
'.$langs->trans("SendNewPassword").'
'; + else print '
'.$langs->trans("SendNewPassword").'
'; + } + } + + // Activer + if ($user->id <> $id && $candisableuser && $object->statut == 0 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print '
'.$langs->trans("ReinitPassword").'
'; + print '
'.$langs->trans("Reactivate").'
'; } - - if ($object->statut == 0) - { - print '
'.$langs->trans("SendNewPassword").'
'; - } - else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + // Desactiver + if ($user->id <> $id && $candisableuser && $object->statut == 1 && ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - if ($object->email) print '
'.$langs->trans("SendNewPassword").'
'; - else print '
'.$langs->trans("SendNewPassword").'
'; + print '
'.$langs->trans("DisableUser").'
'; } - } - - // Activer - if ($user->id <> $id && $candisableuser && $object->statut == 0 && - ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - print '
'.$langs->trans("Reactivate").'
'; - } - // Desactiver - if ($user->id <> $id && $candisableuser && $object->statut == 1 && - ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - print '
'.$langs->trans("DisableUser").'
'; - } - // Delete - if ($user->id <> $id && $candisableuser && - ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) - { - if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin + // Delete + if ($user->id <> $id && $candisableuser && + ((empty($conf->multicompany->enabled) && $object->entity == $user->entity) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) { - print '
'.$langs->trans("DeleteUser").'
'; - } - else - { - print '
'.$langs->trans("DeleteUser").'
'; + if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin + { + print '
'.$langs->trans("DeleteUser").'
'; + } + else + { + print '
'.$langs->trans("DeleteUser").'
'; + } } } - + print "
\n";