Fix: superadmin is downgrade after update
This commit is contained in:
parent
30d5bedad3
commit
22cc5c7035
@ -1137,8 +1137,6 @@ class User extends CommonObject
|
|||||||
$adh->user_id=$this->id;
|
$adh->user_id=$this->id;
|
||||||
$adh->user_login=$this->login;
|
$adh->user_login=$this->login;
|
||||||
|
|
||||||
//$adh->entity=$this->entity;
|
|
||||||
|
|
||||||
$result=$adh->update($user,0,1);
|
$result=$adh->update($user,0,1);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1584,7 +1584,8 @@ else
|
|||||||
{
|
{
|
||||||
$yn = yn($fuser->admin);
|
$yn = yn($fuser->admin);
|
||||||
print '<input type="hidden" name="admin" value="'.$fuser->admin.'">';
|
print '<input type="hidden" name="admin" value="'.$fuser->admin.'">';
|
||||||
if (! empty($conf->multicompany->enabled) && ! $fuser->entity) print $form->textwithpicto($yn,$langs->trans("DontDowngradeSuperAdmin"),1,'warning');
|
print '<input type="hidden" name="superadmin" value="'.(empty($fuser->entity) ? 1 : 0).'">';
|
||||||
|
if (! empty($conf->multicompany->enabled) && empty($fuser->entity)) print $form->textwithpicto($yn,$langs->trans("DontDowngradeSuperAdmin"),1,'warning');
|
||||||
else print $yn;
|
else print $yn;
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user