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:
skeeter 2001-03-30 04:42:23 +00:00
parent 278bd972c1
commit 0224d6d9da
3 changed files with 63 additions and 0 deletions

View 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);
}
?>

View 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);
}
?>

View File

@ -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>';