forked from extern/egroupware
Added change_owner to the xml-rpc/soap calls and changed the call to change_owner in deletaccount hook to use execmethod.
This commit is contained in:
parent
998d7dcc6e
commit
6bb1bfae0a
@ -20,6 +20,7 @@
|
||||
'read_entry' => True,
|
||||
'delete_entry' => True,
|
||||
'delete_calendar' => True,
|
||||
'change_owner' => True,
|
||||
'update' => True,
|
||||
'preferences' => True,
|
||||
'store_to_cache' => True,
|
||||
@ -52,6 +53,14 @@
|
||||
'int'
|
||||
)
|
||||
),
|
||||
'change_owner' => Array(
|
||||
'in' => Array(
|
||||
'array'
|
||||
),
|
||||
'out' => Array(
|
||||
'int'
|
||||
)
|
||||
),
|
||||
'update' => Array(
|
||||
'in' => Array(
|
||||
'array',
|
||||
@ -305,6 +314,11 @@
|
||||
'signature' => array(array(xmlrpcInt,xmlrpcInt)),
|
||||
'docstring' => lang('Delete an entire users calendar.')
|
||||
),
|
||||
'change_owner' => array(
|
||||
'function' => 'change_owner',
|
||||
'signature' => array(array(xmlrpcInt,xmlrpcStruct)),
|
||||
'docstring' => lang('Change all events for $params[\'old_owner\'] to $params[\'new_owner\'].')
|
||||
),
|
||||
'store_to_cache' => array(
|
||||
'function' => 'store_to_cache',
|
||||
'signature' => array(array(xmlrpcStruct,xmlrpcStruct)),
|
||||
@ -493,11 +507,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
function change_owner($account_id,$new_owner)
|
||||
function change_owner($params='')
|
||||
{
|
||||
if($GLOBALS['phpgw_info']['server']['calendar_type'] == 'sql')
|
||||
{
|
||||
$this->so->change_owner($account_id,$new_owner);
|
||||
if(is_array($params))
|
||||
{
|
||||
$this->so->change_owner($params['old_owner'],$params['new_owner']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,14 +12,17 @@
|
||||
/* $Id$ */
|
||||
|
||||
// Delete all records for a user
|
||||
$cal = CreateObject('calendar.bocalendar');
|
||||
|
||||
if(intval($GLOBALS['HTTP_POST_VARS']['new_owner'])==0)
|
||||
{
|
||||
$cal->delete_calendar(intval($GLOBALS['HTTP_POST_VARS']['account_id']));
|
||||
ExecMethod('calendar.bocalendar.delete_calendar',intval($GLOBALS['HTTP_POST_VARS']['account_id']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$cal->change_owner(intval($GLOBALS['HTTP_POST_VARS']['account_id']),intval($GLOBALS['HTTP_POST_VARS']['new_owner']));
|
||||
ExecMethod('calendar.bocalendar.change_owner',
|
||||
Array(
|
||||
'old_owner' => intval($GLOBALS['HTTP_POST_VARS']['account_id']),
|
||||
'new_owner' => intval($GLOBALS['HTTP_POST_VARS']['new_owner'])
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user