require_once("include/bittorrent.php"); function bark($msg) { stderr( _("Delete failed!"), $msg); exit; } if (!isset( $_POST['id']) ) bark( _("missing form data") ); $id = (int) $_POST['id']; if (!$id) stderr( _("Error"), _("Input missing")); dbconn(false); loggedinorreturn(); $res = mysql_query("SELECT name,owner,seeders FROM torrents WHERE id = $id"); $row = mysql_fetch_array($res); if (!$row) die(); if ($CURUSER["id"] != $row["owner"] && get_user_class() < UC_MODERATOR) bark( _("You're not the owner! How did that happen?") ); $rt = (int) $_POST["reasontype"]; if (!is_int($rt) || $rt < 1 || $rt > 5) bark(_("Invalid reason.")); $r = $_POST["r"]; $reason = $_POST["reason"]; if ($rt == 1) $reasonstr = _("Dead: 0 seeders, 0 leechers = 0 peers total"); elseif ($rt == 2) $reasonstr = _("Dupe") . ($reason[0] ? (": " . trim($reason[0])) : "!"); elseif ($rt == 3) $reasonstr = _("Nuked") . ($reason[1] ? (": " . trim($reason[1])) : "!"); elseif ($rt == 4) { if (!$reason[2]) bark( _("Please describe the violated rule.")); $reasonstr = _("TB rules broken").": " . trim($reason[2]); } else { if (!$reason[3]) bark( _("Please enter the reason for deleting this torrent.") ); $reasonstr = trim($reason[3]); } deletetorrent($id); write_log("Torrent $id (".$row['name'].") was deleted by ".(($CURUSER['anonymous'] == 'yes') ? 'Anonymous' : $CURUSER["username"])." (".strip_tags($reasonstr).")\n"); stdhead( _("Torrent deleted!") ); if (isset($_POST["returnto"])) $ret = ""._('Go back to whence you came').""; else $ret = ""._('Back to index').""; ?>
= $ret ?>
stdfoot(); ?>