N°4036 - User edition controls : a user cannot remove contact

This commit is contained in:
Eric
2021-07-28 13:09:18 +02:00
parent 8dae459b12
commit 14a5f87d62

View File

@@ -408,8 +408,9 @@ abstract class User extends cmdbAbstractObject
// A contact is mandatory (an administrator can bypass it but not for himself)
if ((!UserRights::IsAdministrator() || $this->IsCurrentUser())
&& !$this->IsNew()
&& isset($aChanges['contactid'])
&& ((empty($this->GetOriginal('contactid')) && !($this->IsNew())) || empty($this->Get('contactid')))) {
&& empty($this->Get('contactid'))) {
$this->m_aCheckIssues[] = Dict::S('Class:User/Error:PersonIsMandatory');
}