mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 08:09:02 +01:00
Misnamed hook file. This will now either delete all records for the user or change ownership to another user when deleting a user.
This commit is contained in:
parent
278bd972c1
commit
0224d6d9da
29
addressbook/inc/hook_addressbook_deleteaccount.inc.php
Executable file
29
addressbook/inc/hook_addressbook_deleteaccount.inc.php
Executable file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Joseph Engo <jengo@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
/* $Id$ */
|
||||
// Delete all records for a user
|
||||
if (floor($PHP_VERSION ) == 4)
|
||||
{
|
||||
global $account_id, $new_owner;
|
||||
}
|
||||
|
||||
$contacts = CreateObject('phpgwapi.contacts');
|
||||
|
||||
if($new_owner==0)
|
||||
{
|
||||
$contacts->delete_all($account_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$contacts->change_owner($account_id,$new_owner);
|
||||
}
|
||||
?>
|
31
calendar/inc/hook_calendar_deleteaccount.inc.php
Executable file
31
calendar/inc/hook_calendar_deleteaccount.inc.php
Executable file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**************************************************************************\
|
||||
* phpGroupWare *
|
||||
* http://www.phpgroupware.org *
|
||||
* Written by Mark Peters <skeeter@phpgroupware.org> *
|
||||
* -------------------------------------------- *
|
||||
* This program is free software; you can redistribute it and/or modify it *
|
||||
* under the terms of the GNU General Public License as published by the *
|
||||
* Free Software Foundation; either version 2 of the License, or (at your *
|
||||
* option) any later version. *
|
||||
\**************************************************************************/
|
||||
/* $Id$ */
|
||||
|
||||
// Delete all records for a user
|
||||
if (floor($PHP_VERSION ) == 4)
|
||||
{
|
||||
global $account_id, $new_owner;
|
||||
}
|
||||
|
||||
$calendar = CreateObject('calendar.calendar');
|
||||
$cal_stream = $calendar->open('INBOX',$account_id,'');
|
||||
|
||||
if($new_owner==0)
|
||||
{
|
||||
$calendar->delete_calendar($cal_stream,$account_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$calendar->change_owner($account_id,$new_owner);
|
||||
}
|
||||
?>
|
@ -36,6 +36,9 @@
|
||||
echo '<a href="' . $phpgw->link('/calendar/preferences.php') . '">' . lang('Calendar preferences')
|
||||
. '</a><br>';
|
||||
|
||||
echo '<a href="' . $phpgw->link('/calendar/categories.php') . '">'
|
||||
. lang('Edit Categories') . '</a><br>';
|
||||
|
||||
echo '<a href="' . $phpgw->link('/calendar/acl_preferences.php') . '">'
|
||||
. lang('Grant Calendar Access') . '</a>';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user