From: <ral...@us...> - 2014-03-28 17:58:24
|
Author: ralfbecker Date: Fri Mar 28 18:58:17 2014 New Revision: 46436 URL: http://svn.stylite.de/viewvc/egroupware?rev=46436&view=rev Log: dont save account-data, if they are not changed Modified: trunk/admin/inc/class.admin_account.inc.php Modified: trunk/admin/inc/class.admin_account.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/admin/inc/class.admin_account.inc.php?rev=46436&r1=46435&r2=46436&view=diff ============================================================================== --- trunk/admin/inc/class.admin_account.inc.php (original) +++ trunk/admin/inc/class.admin_account.inc.php Fri Mar 28 18:58:17 2014 @@ -96,6 +96,10 @@ '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 @@ */ 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( |