// This file is part of the Project JJ PHP Chat distribution.
// Created and maintained by Tino Didriksen
// The contents of this file is subject to a license.
// Read license.txt and readme.txt for more information.
if ($_REQUEST['source']) {
readfile(__FILE__);
die();
}
?>
Chat Deletion Form
|
|
include("mysql.php");
include("setup.php");
function RmDirR($xdir) {
$d = dir($xdir);
while($entry = $d->read()) {
if ($entry != "." && $entry != "..") {
if (Is_Dir($xdir."/".$entry)) {
RmDirR($xdir."/".$entry);
} else {
echo "Deleting $xdir/$entry \n";
UnLink($xdir."/".$entry);
}
}
}
$d->close();
RmDir($xdir);
}
$cpath = strtolower(eregi_replace("([^-[:alnum:]_]+)", "", $_REQUEST['cpath']));
if ($cpath == $master_chat) {
echo "$master_chat is protected. \n";
exit();
} else if ($cpath == 'sfw') {
die();
}
$ok = false;
if ((strtolower($_REQUEST['user']) != 'jezral') || ($_SERVER['REMOTE_ADDR'] == '194.192.135.214')
|| ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') || ($_SERVER['REMOTE_ADDR'] == '66.135.33.101'))
$ok = true;
if ($ok == false)
die('You are not authorized.');
if (($_REQUEST['user'] != "") && ($_REQUEST['pass'] != "") && ($_REQUEST['email'] != "") && ($_REQUEST['verify'] != "") && ($cpath != "") && (file_exists($cpath."/sendmsg.php")) && (file_exists($cpath."/settings.php"))) {
$user = strtolower($_REQUEST['user']);
$user = eregi_replace($master_name_filter, "", $user);
$epass = $_REQUEST['pass'];
$pass = md5($_REQUEST['pass']);
$result = mysql_query("SELECT chat,username,password FROM uo_chat_database WHERE chat='chat$cpath' AND username='$user' AND password='$pass' AND ( flags='m' OR flags='M' )", $handler);
$cuser = mysql_fetch_row($result);
@mysql_free_result($result);
if (($cuser[0] == "chat".$cpath) && (strtolower($cuser[1]) == $user) && ($cuser[2] == $pass)) {
// Deleting dirs and files
if ($cpath != "") {
//echo exec("rmdir /s /q ".$cpath).$cpath." \n";
echo RmDirR($cpath)." \n";
}
// Deleting database entries
$tables = array(
"uo_chat",
"uo_chat_stats",
"uo_chat_ban",
"uo_chat_boards",
"uo_chat_char",
"uo_chat_database",
"uo_chat_faction",
"uo_chat_ignore",
"uo_chat_images",
"uo_chat_last",
"uo_chat_log",
"uo_chat_message",
"uo_chat_poll",
"uo_chat_threads",
"uo_chat_ulist",
"uo_chat_vote"
);
$killme = "chat".$cpath;
echo "Deleting $killme... \n";
for ($q=0;$q\n";
$query = mysql_query($query, $handler);
}
$subject = "Project JJ: Chat Deleted: $cpath";
$body = "Time: ".date("g:ia, F d (T)", time(0))."\nUnix time: ".time(0)."\n";
$body .= "IP: {$_SERVER['REMOTE_ADDR']}\n";
$body .= "Username: $user\n";
$body .= "Password: $epass\n";
$body .= "Chat: $cpath\n";
$body .= "Email: $email\n\n";
$body .= "Deletion successful.\n";
$addrs = "$master_email,$email";
mail($addrs, $subject, $body, "From: $email\n");
} else {
echo "False login or path. \n";
$subject = "Project JJ: Deletion Attempt: $cpath";
$body = "Time: ".date("g:ia, F d (T)", time(0))."\nUnix time: ".time(0)."\n";
$body .= "IP: {$_SERVER['REMOTE_ADDR']}\n";
$body .= "Username: $user\n";
$body .= "Password: $epass\n";
$body .= "Chat: $cpath\n";
$body .= "Email: $email\n\n";
$body .= "Deletion not successful.\n";
$addrs = "$master_email,$email";
mail($addrs, $subject, $body, "From: $email\n");
}
} else {
?>
This form will in every respect delete a chat.
Only the Chat Master can do this.
Once submitted, the chat will be deleted. This is not reversible.
}
?>
|
|
|
|
|