$data) { switch($type) { case "order": case "name": case "md5": case "user": SetURLArgument($type,$data); break; } } if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST)) { if ($_POST['action'] == 'delete') { MustBeLoggedIn(); $file = GetWadName($_POST['id']); $row = RunQueryOnce("SELECT UserID FROM ZanWADs WHERE Name = ?", array(1 => $file)); if ($row['UserID'] == GetUserID() || GetUserLevel() >= $settings['userlevels']['admin']) { if (file_exists("{$this['settings']['directories']['pwad']}/{$file}")) { if (unlink("{$this['settings']['directories']['pwad']}/{$file}")) { RunQueryOnly("DELETE FROM ZanWADs WHERE Name = ?", array(1 => $file)); $_SESSION['MESSAGE'] = "WAD File {$file} deleted"; $param = "F{{$file}}"; if ($row['UserID'] != GetUserID()) { LogAction('ZanModLog', 'DELETEWAD', $param); } else { LogAction('ZanUserLog', 'DELETEWAD', $param); } } else { $_SESSION['MESSAGE'] = " Error: WAD File {$file} cannot be deleted, please contact an Administrator"; } } else { $_SESSION['MESSAGE'] = "Error: WAD File {$file} does not exist"; } } else { $_SESSION['MESSAGE'] = "Error: You don't own the WAD file {$file}"; } } if (isset($_POST['action'])) { AjaxMessage($_SESSION['MESSAGE']); header('Location: '.BuildURL()); die; } } ?>