Fix: seul le surperadmin peut modifier le superadmin
This commit is contained in:
parent
d6203a95f1
commit
2a39d44657
@ -1037,11 +1037,11 @@ else
|
|||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
|
||||||
if ($caneditfield)
|
if ($caneditfield && (($fuser->entity == $conf->entity)||($fuser->id == $user->id)))
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("Modify").'</a>';
|
||||||
}
|
}
|
||||||
elseif ($caneditpassword && ! $fuser->ldap_sid)
|
elseif ($caneditpassword && ! $fuser->ldap_sid && $fuser->entity == $conf->entity)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("EditPassword").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("EditPassword").'</a>';
|
||||||
}
|
}
|
||||||
@ -1049,29 +1049,29 @@ else
|
|||||||
// Si on a un gestionnaire de generation de mot de passe actif
|
// Si on a un gestionnaire de generation de mot de passe actif
|
||||||
if ($conf->global->USER_PASSWORD_GENERATED != 'none')
|
if ($conf->global->USER_PASSWORD_GENERATED != 'none')
|
||||||
{
|
{
|
||||||
if (($user->id != $_GET["id"] && $caneditpassword) && $fuser->login && !$fuser->ldap_sid)
|
if (($user->id != $_GET["id"] && $caneditpassword) && $fuser->login && !$fuser->ldap_sid && $fuser->entity == $conf->entity)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=password">'.$langs->trans("ReinitPassword").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=password">'.$langs->trans("ReinitPassword").'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($user->id != $_GET["id"] && $caneditpassword) && $fuser->email && $fuser->login && !$fuser->ldap_sid)
|
if (($user->id != $_GET["id"] && $caneditpassword) && $fuser->email && $fuser->login && !$fuser->ldap_sid && $fuser->entity == $conf->entity)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activer
|
// Activer
|
||||||
if ($user->id <> $_GET["id"] && $candisableperms && $fuser->statut == 0)
|
if ($user->id <> $_GET["id"] && $candisableperms && $fuser->statut == 0 && $fuser->entity == $conf->entity)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
||||||
}
|
}
|
||||||
// Desactiver
|
// Desactiver
|
||||||
if ($user->id <> $_GET["id"] && $candisableperms && $fuser->statut == 1)
|
if ($user->id <> $_GET["id"] && $candisableperms && $fuser->statut == 1 && $fuser->entity == $conf->entity)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?action=disable&id='.$fuser->id.'">'.$langs->trans("DisableUser").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?action=disable&id='.$fuser->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||||
}
|
}
|
||||||
|
// Delete
|
||||||
if ($user->id <> $_GET["id"] && $candisableperms)
|
if ($user->id <> $_GET["id"] && $candisableperms && $fuser->entity == $conf->entity)
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$fuser->id.'">'.$langs->trans("DeleteUser").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$fuser->id.'">'.$langs->trans("DeleteUser").'</a>';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user