mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
* AD/LDAP/InfoLog: change group owners on account-migration
This commit is contained in:
parent
dcb78d9776
commit
6c15873c4f
@ -301,4 +301,37 @@ class infolog_customfields extends admin_customfields
|
|||||||
Api\Storage\Customfields::save('infolog', $this->fields);
|
Api\Storage\Customfields::save('infolog', $this->fields);
|
||||||
Api\Config::save_value('group_owners',$this->group_owners,'infolog');
|
Api\Config::save_value('group_owners',$this->group_owners,'infolog');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change account_ids in group_owners configuration hook called from admin_cmd_change_account_id
|
||||||
|
*
|
||||||
|
* @param array $changes
|
||||||
|
* @return int number of changed account_ids
|
||||||
|
*/
|
||||||
|
public static function change_account_ids(array $changes)
|
||||||
|
{
|
||||||
|
unset($changes['location']); // no change, but the hook name
|
||||||
|
$changed = 0;
|
||||||
|
|
||||||
|
// migrate staff account_ids
|
||||||
|
$config = Api\Config::read('infolog');
|
||||||
|
if (!empty($config['group_owners']))
|
||||||
|
{
|
||||||
|
foreach($config['group_owners'] as &$account_id)
|
||||||
|
{
|
||||||
|
if (isset($changes[$account_id]))
|
||||||
|
{
|
||||||
|
$account_id = $changes[$account_id];
|
||||||
|
$changed++;
|
||||||
|
$needs_save = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($needs_save)
|
||||||
|
{
|
||||||
|
Api\Config::save_value('group_owners', $config['group_owners'], 'infolog');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $changed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ $setup_info['infolog']['hooks']['pm_custom_app_icons'] = 'infolog.infolog_bo.pm_
|
|||||||
$setup_info['infolog']['hooks']['timesheet_set'] = 'infolog.infolog_ui.timesheet_set';
|
$setup_info['infolog']['hooks']['timesheet_set'] = 'infolog.infolog_ui.timesheet_set';
|
||||||
$setup_info['infolog']['hooks']['calendar_set'] = 'infolog.infolog_ui.calendar_set';
|
$setup_info['infolog']['hooks']['calendar_set'] = 'infolog.infolog_ui.calendar_set';
|
||||||
$setup_info['infolog']['hooks']['mail_import'] = 'infolog_hooks::mail_import';
|
$setup_info['infolog']['hooks']['mail_import'] = 'infolog_hooks::mail_import';
|
||||||
|
$setup_info['infolog']['hooks']['change_account_ids'] = 'infolog_customfields::change_account_ids';
|
||||||
|
|
||||||
// Dependencies for this app to work
|
// Dependencies for this app to work
|
||||||
$setup_info['infolog']['depends'][] = array(
|
$setup_info['infolog']['depends'][] = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user