added a hook_deleteaccount

This commit is contained in:
Ralf Becker 2002-11-20 19:58:15 +00:00
parent 6137f2c184
commit 839e094117
3 changed files with 37 additions and 0 deletions

View File

@ -210,6 +210,22 @@
}
}
function change_delete_owner($owner,$new_owner=0) // new_owner=0 means delete
{
if (!$new_owner)
{
$sql = "delete FROM phpgw_infolog where info_owner='$owner'";
$sql2 = "update phpgw_infolog set info_responsible='0' where info_responsible='$owner'";
}
else
{
$sql = "update phpgw_infolog set info_owner='$new_owner' where info_owner='$owner'";
$sql2 = "update phpgw_infolog set info_responsible='$new_owner' where info_responsible='$owner'";
}
$this->db->query($sql,__LINE__,__FILE__);
$this->db->query($sql2,__LINE__,__FILE__);
}
function write($values) // did _not_ ensure ACL
{
include(PHPGW_SERVER_ROOT.'/infolog/setup/tables_current.inc.php');

View File

@ -0,0 +1,20 @@
<?php
/**************************************************************************\
* phpGroupWare *
* http://www.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
$info = CreateObject('infolog.soinfolog');
$info->change_delete_owner(intval($GLOBALS['HTTP_POST_VARS']['account_id']),
intval($GLOBALS['HTTP_POST_VARS']['new_owner']));
unset($info);
?>

View File

@ -47,6 +47,7 @@
/* The hooks this app includes, needed for hooks registration */
$setup_info['infolog']['hooks'][] = 'preferences';
$setup_info['infolog']['hooks'][] = 'admin';
$setup_info['infolog']['hooks'][] = 'deleteaccount';
$setup_info['infolog']['hooks'][] = 'about';
$setup_info['infolog']['hooks'][] = 'home';
$setup_info['infolog']['hooks'][] = 'addressbook_view';