website/members/deluser.php
2001-06-06 05:55:58 +00:00

61 lines
1.8 KiB
PHP

<? // Preamble
$pageName = "Admin - Delete User";
$focused = "home"; // Dock icon name to get a border
$need = 'auth';
require '../parts/preamble.php'; // Load most of document
?>
<?
if ($userInfo[u_admin] == 'Y' && $u_username) {
need ('sql');
$u_username = AddSlashes ($u_username);
$conn = mysql_connect (sqlHost, sqlUser, sqlPass);
if ($conn) {
$query = "DELETE FROM members WHERE u_username = '$u_username'";
$result = mysql_db_query (sqlDB, $query, $conn);
if ($result) {
$numRows = mysql_affected_rows ($conn);
if ($numRows) {
echo '<P>User removed from members dbase successfully.';
} else {
echo '<P>User was not found in members database.';
}
} else {
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
}
$query = "DELETE FROM devel_plans WHERE p_user = '$p_username'";
$result = mysql_db_query (sqlDB, $query, $conn);
if ($result) {
$numRows = mysql_affected_rows ($conn);
if ($numRows) {
echo '<P>User removed from plan dbase successfully.';
echo '<P>This webpage will self-destruct in 30 seconds.';
} else {
echo '<P>User was not found in plan database.';
}
} else {
echo '<P>There was an error in your input. The error was ' . mysql_error ($conn);
}
mysql_close ($conn);
} else {
echo '<P>You suck, butthead.';
}
} else {
if ($userInfo[u_admin] == 'Y') {
?>
<FORM action="deluser.php" method="post">
<P>Good morning Mr. Phelps, who will we be eliminating today?
<P>Username: <INPUT type="text" name="u_username" size="12"></INPUT>
</FORM>
<?
} else {
echo 'You are not authorized to view this page. Now go away or I shall taunt you a second time!';
}
}
?>
<?
require siteHome . '/parts/postamble.php'; // Finish this sucker up
?>