exec("set names utf8"); $gameDB = new MYSQL_Database(DB_TYPE, DB_HOST_LAN, GAME_DB_NAME, GAME_DB_USER, GAME_DB_PASS); $gameDB->exec("set names utf8"); ?>
", $message); $denied = isset($_REQUEST['denied']) ? intval($_REQUEST['denied']) : 0; $siteDB->insert("ban_appeal", [ 'guid' => $_SESSION['account'], 'banid' => $_REQUEST['banid'], 'message' => $message, 'denied' => $denied ]); $lid = $siteDB->lastInsertId(); } } if (isset($_REQUEST['send_message']) && $lid != -1) { $err = 'Message Sent'; } if (isset($_REQUEST['send_message_and_unban'])) { if ($_REQUEST['message'] == '') { $err = 'Please type a response message.'; } else { // $unbanReason = isset($_REQUEST['unbanReason']) ? $_REQUEST['unbanReason'] : ''; // $unbanReason = strip_tags($unbanReason); $banInfo = $gameDB->select(" SELECT * FROM account_banned WHERE banid = :banid AND active = 1 ", [ 'banid' => $_REQUEST['banid'] ]); if (count($banInfo) == 0) { echo "something went wrong, cant find this ban."; exit; } $gameDB->update("account_banned", [ 'active' => 0, 'unbandate' => intval($banInfo[0]['unbandate']) + 1, // 'banreason' => $banInfo[0]['banreason'] . ' ' . $unbanReason ], [ 'banid' => $_REQUEST['banid'] ]); // delete fingerprint bans too $fingerprints = $gameDB->select(" SELECT fingerprint FROM system_fingerprint_usage WHERE account = :account", [ 'account' => $banInfo[0]['id'] ]); foreach ($fingerprints as $key => $fp) $gameDB->delete('fingerprint_autoban', [ 'fingerprint' => $fp['fingerprint'] ]); $err = 'Message Sent and Account Unbanned'; // DELETE FROM fingerprint_autoban WHERE fingerprint IN (SELECT fingerprint FROM system_fingerprint_usage WHERE account = 1 ) } } if (isset($_REQUEST['send_message_and_deny_appeal'])) { if ($lid !== -1) { $siteDB->update("ban_appeal", [ 'denied' => 1 ], [ 'id' => $lid ]); $err = 'Message send and Appeal Denied'; } } if (isset($_REQUEST['deny_appeal'])) { $lastMessage = $siteDB->select(" SELECT id FROM ban_appeal WHERE banid = :banid ORDER BY stamp DESC LIMIT 1", [ 'banid' => $_REQUEST['banid'] ]); if (count($lastMessage) != 1) exit('something went wrong, cant find banid/appeal'); $id = $lastMessage[0]['id']; $siteDB->update("ban_appeal", [ 'denied' => 1 ], [ 'id' => $id ]); $err = 'Appeal Denied.'; } } if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'respond') { // ban details if (!filter_var($_REQUEST['banid'], FILTER_VALIDATE_INT)) exit('wrong banid'); $ban = $siteDB->select(" SELECT * FROM ban_appeal WHERE banid = :banid ORDER BY stamp ASC", [ 'banid' => $_REQUEST['banid'] ]); if (count($ban) == 0) exit("Something went wrong, wrong appeal id"); $ban_status = $ban[count($ban) - 1]; $ban = $ban[0]; if (isset($_REQUEST['change_ban_duration']) && $_REQUEST['change_ban_duration'] != 0) { $now = date('U'); $new_duration = $now + $_REQUEST['change_ban_duration'] * 24 * 60 * 60; $gameDB->update("account_banned", [ 'unbandate' => $new_duration ], [ 'banid' => $_REQUEST['banid'] ]); } if (isset($_REQUEST['banreason']) && $_REQUEST['banreason'] != '') { $gameDB->update("account_banned", [ 'banreason' => $_REQUEST['banreason'] ], [ 'banid' => $_REQUEST['banid'] ]); } // get account details because site and game dbs run on different machines and cant join in one query $details = $gameDB->select(" SELECT l.username, ab.bandate, ab.bannedby, ab.banreason, ab.active, ab.unbandate FROM " . GAME_DB_ACCOUNT . " l LEFT JOIN account_banned ab on l.id = ab.id WHERE l.id = :id ORDER BY ab.bandate DESC LIMIT 1", [ 'id' => $ban['guid'] ]); //if (count($details) != 1) // exit('something went wrong, cant find account'); $details = $details[0]; $ban['username'] = $details['username']; $ban['bandate'] = $details['bandate']; $ban['unbandate'] = $details['unbandate']; $ban['bannedby'] = $details['bannedby']; $ban['banreason'] = $details['banreason']; $ban['active'] = $details['active']; // $messages = $siteDB->select("SELECT s.guid, s.message, s.stamp, // l.username, s.denied // FROM ban_appeal s // LEFT JOIN " . GAME_DB_NAME . ".account l ON s.guid = l.id // WHERE s.banid = :banid // ORDER BY stamp", [ // 'banid' => $ban['banid'] // ]); $messages = $siteDB->select("SELECT s.guid, s.message, s.stamp, s.denied FROM ban_appeal s WHERE s.banid = :banid ORDER BY stamp", [ 'banid' => $ban['banid'] ]); // get guids of the accounts in this conversation $guids = []; foreach ($messages as $key => $m) if (!in_array($m['guid'], $guids)) $guids[] = $m['guid']; //LEFT JOIN " . GAME_DB_NAME . ".account l ON s.guid = l.id $gm_names_result = $gameDB->select("SELECT id, username from " . GAME_DB_NAME . ".account WHERE id IN (" . implode(",", $guids) . ")"); $gm_names = []; foreach ($gm_names_result as $key => $res) $gm_names[$res['id']] = $res['username']; foreach ($messages as $key => $m) $messages[$key]['stamp'] = date('H:i d/m/Y', strtotime($m['stamp'])); $messages[$key]['username'] = $gm_names[$m['guid']]; ?>
Back to list Refresh

Ban Info

"; echo ""; echo ""; echo ""; echo ""; $tl = ''; $status = ''; if ($ban['active'] == 1) { $seconds = $ban['unbandate'] - time(); if ($seconds > 0) { $dtF = new \DateTime('@0'); $dtT = new \DateTime("@$seconds"); $tl = $dtF->diff($dtT)->format('%a days, %h hours and %i minutes') . "
"; } else { $tl = 'Permanent'; } if ($ban_status['denied'] == 1) $status = "Denied"; } else { $status = "Unbanned"; } echo ""; ?>
Account Name Ban Date Banned By Ban Reason Duration Status
" . $ban['username'] . "" . Date('H:i:s d/m/Y', $ban['bandate']) . "" . $ban['bannedby'] . "" . $ban['banreason'] . " (" . $ban['unbandate'] . "/" . $ban['active'] . ")
"; echo "" . $tl . ""; if ($ban['active'] == 1) { ?>
"; echo "
" . $status . "

Message history

$m) { ?>
" . $m['username'] . " (Turtle WoW Support)"; else echo "
" . $m['username'] . ""; ?>
" ?>
select(" SELECT * FROM ban_appeal ORDER BY stamp DESC"); $appeals = []; foreach ($all as $key => $a) { $appeals[$a['banid']] = $a; } $stats = [ 'unbanned' => 0, 'denied' => 0, 'new' => 0, 'responded' => 0 ]; foreach ($appeals as $key => $ap) { // get account details because site and game dbs run on different machines and cant join in one query $details = $gameDB->select(" SELECT l.username, ab.bandate, ab.bannedby, ab.banreason, ab.active FROM " . GAME_DB_ACCOUNT . " l LEFT JOIN account_banned ab on l.id = ab.id WHERE l.id = :id ORDER BY ab.bandate DESC LIMIT 1", [ 'id' => $ap['guid'] ]); //if (count($details) != 1) { // unset($appeals[$key]); // continue; //} $details = $details[0]; $appeals[$key]['username'] = $details['username']; $appeals[$key]['bandate'] = $details['bandate']; $appeals[$key]['bannedby'] = $details['bannedby']; $appeals[$key]['banreason'] = $details['banreason']; $appeals[$key]['active'] = $details['active']; $appeals[$key]['messages'] = $siteDB->select("SELECT guid, message, stamp, denied FROM ban_appeal ba WHERE banid = :banid ORDER BY stamp DESC LIMIT 1", [ 'banid' => $ap['banid'] ]); $responder = $gameDB->select(" SELECT username FROM " . GAME_DB_ACCOUNT . " WHERE id = :id", [ 'id' => $appeals[$key]['messages'][0]['guid'] ])[0]; $appeals[$key]['messages'][0]['responder'] = $responder['username']; $appeals[$key]['denied'] = $appeals[$key]['messages'][0]['denied']; } foreach ($appeals as $key => $ap) { if ($ap['active'] == 0) $stats['unbanned']++; else if ($ap['denied'] == 1) $stats['denied']++; else if ($ap['messages'][0]['guid'] == $ap['guid']) $stats['new']++; else $stats['responded']++; } ?>

Ban Appeals

$ap) { if (isset($_REQUEST['filter'])) { if ($_REQUEST['filter'] == 'unbanned') if ($ap['active'] != 1) continue; if ($_REQUEST['filter'] == 'denied') if ($ap['denied'] != 1) continue; if ($_REQUEST['filter'] == 'new') if ($ap['messages'][0]['guid'] != $ap['guid'] || $ap['denied'] == 1) continue; if ($_REQUEST['filter'] == 'responded') if ($ap['messages'][0]['guid'] == $ap['guid']) continue; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } ?>
# Account Message Ban Date By/Reason Date Status Actions
" . ($key + 1) . "" . $ap['username'] . "" . date('H:i:s d/m/Y', strtotime($ap['messages'][0]['stamp'])) . "
"; if ($ap['messages'][0]['guid'] == $ap['guid']) echo ""; else echo ""; echo $ap['messages'][0]['message'] . ""; echo "
" . Date('H:i:s d/m/Y', $ap['bandate']) . ""; echo "" . $ap['bannedby'] . "
" . $ap['banreason'] . "
" . Date('H:i:s d/m/Y', strtotime($ap['stamp'])) . ""; if ($ap['active'] == 0) echo "Unbanned"; else { if ($ap['denied'] == 1) { echo "Denied
" . $ap['messages'][0]['responder']; } else { if ($ap['messages'][0]['guid'] == $ap['guid']) echo "New message!"; // last message is from player else echo "Responded
" . $ap['messages'][0]['responder']; // last message is from support } echo ""; } echo "
Respond