From 0224d6d9da1ac6aacb23aa8899c0ead69e44573f Mon Sep 17 00:00:00 2001 From: skeeter Date: Fri, 30 Mar 2001 04:42:23 +0000 Subject: [PATCH] Misnamed hook file. This will now either delete all records for the user or change ownership to another user when deleting a user. --- .../hook_addressbook_deleteaccount.inc.php | 29 +++++++++++++++++ .../inc/hook_calendar_deleteaccount.inc.php | 31 +++++++++++++++++++ calendar/inc/hook_preferences.inc.php | 3 ++ 3 files changed, 63 insertions(+) create mode 100755 addressbook/inc/hook_addressbook_deleteaccount.inc.php create mode 100755 calendar/inc/hook_calendar_deleteaccount.inc.php diff --git a/addressbook/inc/hook_addressbook_deleteaccount.inc.php b/addressbook/inc/hook_addressbook_deleteaccount.inc.php new file mode 100755 index 0000000000..e1a9e25344 --- /dev/null +++ b/addressbook/inc/hook_addressbook_deleteaccount.inc.php @@ -0,0 +1,29 @@ + * + * -------------------------------------------- * + * 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); + } +?> diff --git a/calendar/inc/hook_calendar_deleteaccount.inc.php b/calendar/inc/hook_calendar_deleteaccount.inc.php new file mode 100755 index 0000000000..be7a65a3dc --- /dev/null +++ b/calendar/inc/hook_calendar_deleteaccount.inc.php @@ -0,0 +1,31 @@ + * + * -------------------------------------------- * + * 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); + } +?> diff --git a/calendar/inc/hook_preferences.inc.php b/calendar/inc/hook_preferences.inc.php index a3c9a60205..2d7c35509b 100644 --- a/calendar/inc/hook_preferences.inc.php +++ b/calendar/inc/hook_preferences.inc.php @@ -36,6 +36,9 @@ echo '' . lang('Calendar preferences') . '
'; + echo '' + . lang('Edit Categories') . '
'; + echo '' . lang('Grant Calendar Access') . '';