forked from extern/egroupware
modified the delete hooks to use $GLOBALS['hook_values']
This commit is contained in:
parent
cfa22b9915
commit
1085534c94
@ -12,14 +12,17 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
$contacts = CreateObject('phpgwapi.contacts');
|
||||
if((int)$GLOBALS['hook_values']['account_id'] > 0)
|
||||
{
|
||||
$contacts = CreateObject('phpgwapi.contacts');
|
||||
|
||||
if((int)$_POST['new_owner'] == 0)
|
||||
{
|
||||
$contacts->delete_all((int)$_POST['account_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$contacts->change_owner((int)$_POST['account_id'],(int)$_POST['new_owner']);
|
||||
if((int)$_POST['new_owner'] == 0)
|
||||
{
|
||||
$contacts->delete_all((int)$GLOBALS['hook_values']['account_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$contacts->change_owner((int)$GLOBALS['hook_values']['account_id'],(int)$_POST['new_owner']);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -12,12 +12,12 @@
|
||||
|
||||
/* $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->query("DELETE FROM phpgw_acl WHERE acl_location='" . $_POST['account_id']
|
||||
. "' OR acl_account=".$_POST['account_id'],__LINE__,__FILE__);
|
||||
$GLOBALS['phpgw']->db->query("DELETE FROM phpgw_acl WHERE acl_location='" . (int)$GLOBALS['hook_values']['account_id']
|
||||
. "' OR acl_account=".(int)$GLOBALS['hook_values']['account_id'],__LINE__,__FILE__);
|
||||
$GLOBALS['phpgw']->db->unlock();
|
||||
}
|
||||
?>
|
||||
|
@ -12,17 +12,20 @@
|
||||
/* $Id$ */
|
||||
|
||||
// Delete all records for a user
|
||||
if((int)$_POST['new_owner'] == 0)
|
||||
if((int)$GLOBALS['hook_values']['account_id'] > 0)
|
||||
{
|
||||
ExecMethod('calendar.bocalendar.delete_calendar',(int)$_POST['account_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecMethod('calendar.bocalendar.change_owner',
|
||||
Array(
|
||||
'old_owner' => (int)$_POST['account_id'],
|
||||
'new_owner' => (int)$_POST['new_owner']
|
||||
)
|
||||
);
|
||||
if((int)$_POST['new_owner'] == 0)
|
||||
{
|
||||
ExecMethod('calendar.bocalendar.delete_calendar',(int)$GLOBALS['hook_values']['account_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecMethod('calendar.bocalendar.change_owner',
|
||||
Array(
|
||||
'old_owner' => (int)$GLOBALS['hook_values']['account_id'],
|
||||
'new_owner' => (int)$_POST['new_owner']
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -11,10 +11,13 @@
|
||||
/* $Id$ */
|
||||
|
||||
// Delete all records for a user
|
||||
$info =& CreateObject('infolog.soinfolog');
|
||||
if((int)$GLOBALS['hook_values']['account_id'] > 0)
|
||||
{
|
||||
$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']));
|
||||
|
||||
unset($info);
|
||||
unset($info);
|
||||
}
|
||||
?>
|
||||
|
@ -13,9 +13,12 @@
|
||||
/* $Id$ */
|
||||
|
||||
// Delete all records for a user
|
||||
$table_locks = Array('phpgw_preferences');
|
||||
|
||||
$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->unlock();
|
||||
if((int)$GLOBALS['hook_values']['account_id'] > 0)
|
||||
{
|
||||
$table_locks = Array('phpgw_preferences');
|
||||
|
||||
$GLOBALS['egw']->db->lock($table_locks);
|
||||
$GLOBALS['egw']->db->query('DELETE FROM phpgw_preferences WHERE preference_owner='.(int)$GLOBALS['hook_values']['account_id'],__LINE__,__FILE__);
|
||||
$GLOBALS['egw']->db->unlock();
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user