From d6295ba5133e5eee2c2e8962461db1cfab6d11ab Mon Sep 17 00:00:00 2001 From: skeeter Date: Tue, 21 Nov 2000 02:32:22 +0000 Subject: [PATCH] delete no deletes accounts calendar events --- admin/deleteaccount.php | 3 ++- admin/inc/accounts_sql.inc.php | 18 +++--------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/admin/deleteaccount.php b/admin/deleteaccount.php index a04938a479..85c16b926b 100755 --- a/admin/deleteaccount.php +++ b/admin/deleteaccount.php @@ -18,6 +18,7 @@ } $phpgw_info["flags"]["currentapp"] = "admin"; + $phpgw_info["flags"]["enable_calendar_class"] = True; include("../header.inc.php"); include($phpgw_info["server"]["server_root"] . "/admin/inc/accounts_" . $phpgw_info["server"]["account_repository"] . ".inc.php"); @@ -67,7 +68,7 @@ - + ".lang("All records and account information will be lost!").""; ?> diff --git a/admin/inc/accounts_sql.inc.php b/admin/inc/accounts_sql.inc.php index c5009d704c..44249f8c98 100755 --- a/admin/inc/accounts_sql.inc.php +++ b/admin/inc/accounts_sql.inc.php @@ -170,24 +170,12 @@ $phpgw->db->next_record(); $lid = $phpgw->db->f(0); - $i = 0; - $phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$account_id'"); - while ($phpgw->db->next_record()) { - $cal_id[$i] = $phpgw->db->f("cal_id"); - echo "
" . $phpgw->db->f("cal_id"); - $i++; - } + $table_locks = array('preferences','todo','addressbook','accounts'); + + $phpgw->calendar->delete($lid); - $table_locks = array('preferences','todo','addressbook','accounts', - 'webcal_entry','webcal_entry_user','webcal_entry_repeats', - 'webcal_entry_groups'); $phpgw->db->lock($table_locks); - for ($i=0; $idb->query("delete from webcal_entry_repeats where cal_id='".$cal_id[$i]."'"); - $phpgw->db->query("delete from webcal_entry_groups where cal_id='".$cal_id[$i]."'"); - } - $phpgw->db->query("delete from webcal_entry where cal_create_by='".$account_id."'"); $phpgw->db->query("delete from webcal_entry_user where cal_login='".$account_id."'");