2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - administration *
|
|
|
|
* 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$ */
|
|
|
|
|
|
|
|
if ($confirm) {
|
2000-09-05 20:36:13 +02:00
|
|
|
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2000-09-05 20:36:13 +02:00
|
|
|
$phpgw_info["flags"]["currentapp"] = "admin";
|
2000-08-18 05:24:22 +02:00
|
|
|
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.
|
2000-09-04 23:11:16 +02:00
|
|
|
if ($phpgw_info["user"]["con"] == $con) {
|
2000-08-18 05:24:22 +02:00
|
|
|
Header("Location: " . $phpgw->link("accounts.php"));
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (($con) && (! $confirm)) {
|
|
|
|
?>
|
|
|
|
<center>
|
|
|
|
<table border=0 with=65%>
|
|
|
|
<tr colspan=2>
|
|
|
|
<td align=center>
|
2000-09-07 22:49:55 +02:00
|
|
|
<?php echo lang("Are you sure you want to delete this account ?"); ?>
|
2000-08-18 05:24:22 +02:00
|
|
|
<td>
|
|
|
|
</tr>
|
|
|
|
<tr colspan=2>
|
|
|
|
<td align=center>
|
2000-09-07 22:49:55 +02:00
|
|
|
<?php echo lang("All records and account information will be lost!"); ?>
|
2000-08-18 05:24:22 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>
|
2000-09-07 22:49:55 +02:00
|
|
|
<a href="<?php echo $phpgw->link("accounts.php") . "\">" . lang("No"); ?></a>
|
2000-08-18 05:24:22 +02:00
|
|
|
</td>
|
|
|
|
<td>
|
2000-09-07 22:49:55 +02:00
|
|
|
<a href="<?php echo $phpgw->link("deleteaccount.php","con=$con&confirm=true") . "\">" . lang("Yes"); ?></a>
|
2000-08-18 05:24:22 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</center>
|
2000-08-27 03:59:30 +02:00
|
|
|
<?
|
2000-08-18 05:24:22 +02:00
|
|
|
include($phpgw_info["server"]["api_dir"] . "/footer.inc.php");
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($confirm) {
|
|
|
|
$phpgw->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 "<br>" . $phpgw->db->f("cal_id");
|
|
|
|
$i++;
|
|
|
|
}
|
|
|
|
|
2000-09-18 18:42:24 +02:00
|
|
|
$table_locks = array('preferences','todo','addressbook','accounts',
|
2000-09-05 05:35:42 +02:00
|
|
|
'webcal_entry','webcal_entry_user','webcal_entry_repeats',
|
|
|
|
'webcal_entry_groups');
|
2000-08-18 05:24:22 +02:00
|
|
|
$phpgw->db->lock($table_locks);
|
|
|
|
|
|
|
|
for ($i=0; $i<count($cal_id); $i++) {
|
|
|
|
$phpgw->db->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'");
|
2000-09-25 22:47:40 +02:00
|
|
|
$phpgw->db->query("delete from todo where todo_owner='$lid'");
|
|
|
|
$phpgw->db->query("delete from addressbook where ab_owner='$lid'");
|
2000-08-18 05:24:22 +02:00
|
|
|
$phpgw->db->query("delete from accounts where loginid='$lid'");
|
2000-09-18 18:42:24 +02:00
|
|
|
//$phpgw->db->query("delete from users_headlines where owner='$lid'");
|
2000-08-19 15:27:01 +02:00
|
|
|
//$phpgw->db->query("delete from profiles where owner='$lid'");
|
2000-08-18 05:24:22 +02:00
|
|
|
|
|
|
|
$phpgw->db->unlock();
|
|
|
|
|
2000-08-26 22:12:01 +02:00
|
|
|
$sep = $phpgw->common->filesystem_separator();
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-09-25 22:47:40 +02:00
|
|
|
//$basedir = $phpgw_info["server"]["server_root"] . $sep . "filemanager" . $sep . "users"
|
|
|
|
// . $sep;
|
|
|
|
$basedir = $phpgw_info["server"]["files_dir"] . $sep . "users" . $sep;
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-09-25 22:47:40 +02:00
|
|
|
//echo "<h1> rmdir:".$basedir . $lid."</h1>\n";
|
2000-08-18 05:24:22 +02:00
|
|
|
if (! @rmdir($basedir . $lid)) {
|
|
|
|
$cd = 34;
|
|
|
|
} else {
|
|
|
|
$cd = 29;
|
|
|
|
}
|
|
|
|
|
|
|
|
Header("Location: " . $phpgw->link("accounts.php","cd=$cd"));
|
|
|
|
}
|
2000-09-25 22:47:40 +02:00
|
|
|
?>
|