first step of group prefs (backend only for now)

This commit is contained in:
Ralf Becker
2010-01-27 05:44:31 +00:00
parent 5e3541c5b2
commit 30e13c4acf
3 changed files with 81 additions and 13 deletions

View File

@@ -396,13 +396,19 @@ class preferences_hooks
/**
* Hook called when a user gets deleted, to delete his preferences
*
* @param string|array $hook_data
* @param string|array $data
*/
public static function deleteaccount($hook_data)
public static function deleteaccount($data)
{
if((int)$GLOBALS['hook_values']['account_id'] > 0)
$account_id = (int)$data['account_id'];
if($account_id > 0) // user
{
$GLOBALS['egw']->preferences->delete_user($GLOBALS['hook_values']['account_id']);
$GLOBALS['egw']->preferences->delete_user($account_id);
}
elseif ($account_id < 0) // group
{
$GLOBALS['egw']->preferences->delete_group($account_id);
}
}
}