Skip to content
Snippets Groups Projects
Commit 918ba71e authored by Jean Heimburger's avatar Jean Heimburger
Browse files

FIX #5014

if $user is admin and different from $object then nbadmin >=1 is ok when
not in multicompany
parent 6fffc224
No related branches found
No related tags found
No related merge requests found
...@@ -1914,7 +1914,7 @@ else ...@@ -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
) )
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment