FIX #5014
if $user is admin and different from $object then nbadmin >=1 is ok when not in multicompany
This commit is contained in:
parent
6fffc22466
commit
918ba71e7f
@ -1914,7 +1914,7 @@ else
|
|||||||
if ($user->admin // Need to be admin to allow downgrade of an admin
|
if ($user->admin // Need to be admin to allow downgrade of an admin
|
||||||
&& ($user->id != $object->id) // Don't downgrade ourself
|
&& ($user->id != $object->id) // Don't downgrade ourself
|
||||||
&& (
|
&& (
|
||||||
(empty($conf->multicompany->enabled) && $nbAdmin > 1)
|
(empty($conf->multicompany->enabled) && $nbAdmin >= 1)
|
||||||
|| (! empty($conf->multicompany->enabled) && ($object->entity > 0 || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
|
|| (! empty($conf->multicompany->enabled) && ($object->entity > 0 || $nbSuperAdmin > 1)) // Don't downgrade a superadmin if alone
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user