modified the delete hooks to use $GLOBALS['hook_values']

This commit is contained in:
Lars Kneschke 2005-09-20 10:11:38 +00:00
parent cfa22b9915
commit 1085534c94
5 changed files with 43 additions and 31 deletions

View File

@ -12,14 +12,17 @@
/* $Id$ */ /* $Id$ */
if((int)$GLOBALS['hook_values']['account_id'] > 0)
{
$contacts = CreateObject('phpgwapi.contacts'); $contacts = CreateObject('phpgwapi.contacts');
if((int)$_POST['new_owner'] == 0) if((int)$_POST['new_owner'] == 0)
{ {
$contacts->delete_all((int)$_POST['account_id']); $contacts->delete_all((int)$GLOBALS['hook_values']['account_id']);
} }
else else
{ {
$contacts->change_owner((int)$_POST['account_id'],(int)$_POST['new_owner']); $contacts->change_owner((int)$GLOBALS['hook_values']['account_id'],(int)$_POST['new_owner']);
}
} }
?> ?>

View File

@ -12,12 +12,12 @@
/* $Id$ */ /* $Id$ */
if($_POST['account_id']) if((int)$GLOBALS['hook_values']['account_id'] > 0)
{ {
$GLOBALS['phpgw']->accounts->delete($_POST['account_id']); $GLOBALS['phpgw']->accounts->delete((int)$GLOBALS['hook_values']['account_id']);
$GLOBALS['phpgw']->db->lock(Array('phpgw_acl')); $GLOBALS['phpgw']->db->lock(Array('phpgw_acl'));
$GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE acl_location='" . $_POST['account_id'] $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE acl_location='" . (int)$GLOBALS['hook_values']['account_id']
. "' OR acl_account=".$_POST['account_id'],__LINE__,__FILE__); . "' OR acl_account=".(int)$GLOBALS['hook_values']['account_id'],__LINE__,__FILE__);
$GLOBALS['phpgw']->db->unlock(); $GLOBALS['phpgw']->db->unlock();
} }
?> ?>

View File

@ -12,17 +12,20 @@
/* $Id$ */ /* $Id$ */
// Delete all records for a user // Delete all records for a user
if((int)$GLOBALS['hook_values']['account_id'] > 0)
{
if((int)$_POST['new_owner'] == 0) if((int)$_POST['new_owner'] == 0)
{ {
ExecMethod('calendar.bocalendar.delete_calendar',(int)$_POST['account_id']); ExecMethod('calendar.bocalendar.delete_calendar',(int)$GLOBALS['hook_values']['account_id']);
} }
else else
{ {
ExecMethod('calendar.bocalendar.change_owner', ExecMethod('calendar.bocalendar.change_owner',
Array( Array(
'old_owner' => (int)$_POST['account_id'], 'old_owner' => (int)$GLOBALS['hook_values']['account_id'],
'new_owner' => (int)$_POST['new_owner'] 'new_owner' => (int)$_POST['new_owner']
) )
); );
} }
}
?> ?>

View File

@ -11,10 +11,13 @@
/* $Id$ */ /* $Id$ */
// Delete all records for a user // Delete all records for a user
if((int)$GLOBALS['hook_values']['account_id'] > 0)
{
$info =& CreateObject('infolog.soinfolog'); $info =& CreateObject('infolog.soinfolog');
$info->change_delete_owner(intval($_POST['account_id']), $info->change_delete_owner((int)$GLOBALS['hook_values']['account_id']),
intval($_POST['new_owner'])); intval($_POST['new_owner']));
unset($info); unset($info);
}
?> ?>

View File

@ -13,9 +13,12 @@
/* $Id$ */ /* $Id$ */
// Delete all records for a user // Delete all records for a user
if((int)$GLOBALS['hook_values']['account_id'] > 0)
{
$table_locks = Array('phpgw_preferences'); $table_locks = Array('phpgw_preferences');
$GLOBALS['egw']->db->lock($table_locks); $GLOBALS['egw']->db->lock($table_locks);
$GLOBALS['egw']->db->query('DELETE FROM phpgw_preferences WHERE preference_owner='.(int)$_POST['account_id'],__LINE__,__FILE__); $GLOBALS['egw']->db->query('DELETE FROM phpgw_preferences WHERE preference_owner='.(int)$GLOBALS['hook_values']['account_id'],__LINE__,__FILE__);
$GLOBALS['egw']->db->unlock(); $GLOBALS['egw']->db->unlock();
}
?> ?>