True, "nonavbar" => True); } $phpgw_flags["currentapp"] = "admin"; include("../header.inc.php"); // Make sure they are not attempting to delete there own account. // If they are, they should not reach this point anyway. if ($phpgw->session->con == $con) { Header("Location: " . $phpgw->link("accounts.php")); exit; } if (($con) && (! $confirm)) { $t = new Template($phpgw_info["server"]["template_dir"]); $t->set_file(array("form" => "delete_common.tpl", "message_row" => "delete_common.tpl")); $t->set_var("yes","yes"); $t->set_var("no","no"); $t->set_var("message_display",lang_admin("Are you sure you want to delete this account ?")); $t->set_var("message_display",lang_admin("All records and account information will be lost!")); $t->parse("messages","message_row"); $t->pparse("out","form"); /* ?>
" . lang_common("No"); ?> " . lang_common("Yes"); ?>
db->query("select loginid from accounts where con='$con'"); $phpgw->db->next_record(); $lid = $phpgw->db->f(0); $phpgw->db->query("select cal_id from webcal_entry where cal_create_by='$lid'"); 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','users_headlines', '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='$lid'"); $phpgw->db->query("delete from webcal_entry_user where cal_login='$lid'"); $phpgw->db->query("delete from preferences where owner='$lid'"); $phpgw->db->query("delete from todo where owner='$lid'"); $phpgw->db->query("delete from addressbook where owner='$lid'"); $phpgw->db->query("delete from accounts where loginid='$lid'"); $phpgw->db->query("delete from users_headlines where owner='$lid'"); //$phpgw->db->query("delete from profiles where owner='$lid'"); $phpgw->db->unlock(); $sep = $phpgw->common->filesystem_sepeartor(); $basedir = $phpgw_info["server"]["files_dir"] . $sep . "users" . $sep; if (! @rmdir($basedir . $lid)) { $cd = 34; } else { $cd = 29; } Header("Location: " . $phpgw->link("accounts.php","cd=$cd")); } ?>