Fix some account changes were not saved

This commit is contained in:
nathangray 2020-03-20 10:31:30 -06:00
parent 6c9504e647
commit 7631eb83aa

View File

@ -641,17 +641,20 @@ class Accounts
$old['account_lastname'] != $data['account_lastname'] ||
$old['account_email'] != $data['account_email']))
{
if (!$data['person_id']) $data['person_id'] = $old['person_id'];
if (!$data['person_id'])
{
$data['person_id'] = $old['person_id'];
}
// Include previous contact information to avoid blank history rows
$contact = (array)$GLOBALS['egw']->contacts->read($data['person_id']) + array(
$contact = array_merge((array)$GLOBALS['egw']->contacts->read($data['person_id']), array(
'n_given' => $data['account_firstname'],
'n_family' => $data['account_lastname'],
'email' => $data['account_email'],
'account_id' => $data['account_id'],
'id' => $data['person_id'],
'owner' => 0,
);
));
$GLOBALS['egw']->contacts->save($contact, true); // true = ignore addressbook acl
}
// save primary group if necessary