Merge pull request #5287 from tiaris/devcamp2

Can not modifiy a non admin user to admin (#5014)
This commit is contained in:
Laurent Destailleur 2016-06-04 16:20:46 +02:00
commit e069d7c23a

View File

@ -1914,7 +1914,7 @@ else
if ($user->admin // Need to be admin to allow downgrade of an admin
&& ($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
)
)