Fix: [ bug #641 ] Suppression d'un administrateur
This commit is contained in:
parent
9b95b3e891
commit
fe469b83ab
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
|
||||||
@ -1366,9 +1366,16 @@ else
|
|||||||
// Delete
|
// Delete
|
||||||
if ($user->id <> $id && $candisableuser &&
|
if ($user->id <> $id && $candisableuser &&
|
||||||
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||||
|
{
|
||||||
|
if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$object->id.'">'.$langs->trans("DeleteUser").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$object->id.'">'.$langs->trans("DeleteUser").'</a>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("MustBeAdminToDeleteOtherAdmin")).'">'.$langs->trans("DeleteUser").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print "</div>\n";
|
print "</div>\n";
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user