diff --git a/admin/inc/class.admin_account.inc.php b/admin/inc/class.admin_account.inc.php index 5f6fc0c93a..8f7ef7ceb6 100644 --- a/admin/inc/class.admin_account.inc.php +++ b/admin/inc/class.admin_account.inc.php @@ -96,6 +96,10 @@ class admin_account 'prepend' => true, 'label' => 'Account', 'data' => $account, + // save old values to only trigger save, if one of the following values change (contact data get saved anyway) + 'preserve' => array('old_account' => array_intersect_key($account, array_flip(array( + 'account_lid', 'account_status', 'memberships', 'anonymous', 'changepassword', + 'mustchangepassword', 'account_primary_group', 'homedirectory', 'loginshell')))), 'readonlys' => $readonlys, 'pre_save_callback' => $deny_edit ? null : 'admin_account::addressbook_pre_save', ); @@ -111,6 +115,10 @@ class admin_account */ public static function addressbook_pre_save(&$content) { + if ($content['old_account'] && !array_diff_assoc($content['old_account'], $content)) + { + return ''; // no need to save account data, if nothing changed + } //error_log(__METHOD__."(".array2string($content).")"); $account = array(); foreach(array(