mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 09:28:29 +01:00
added a hook_deleteaccount
This commit is contained in:
parent
6137f2c184
commit
839e094117
@ -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');
|
||||
|
20
infolog/inc/hook_deleteaccount.inc.php
Normal file
20
infolog/inc/hook_deleteaccount.inc.php
Normal 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);
|
||||
?>
|
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user