$userid = $_GET["id"]; mysql_select_db("mta", $conn); $result = mysql_query("SELECT username, banned FROM accounts WHERE id='" . $userid . "' LIMIT 1", $conn); if (!$result || mysql_num_rows($result) == 0) { echo "<p>Account with ID: " . $userid . " was not found.</p>"; } else { $tusername = mysql_result($result, 0, 0); $banned = mysql_result($result, 0, 1); if ($banned != 1) { echo "<p>This account is not banned.</p>"; } else { include "sdk/mta_sdk.php"; try { $mtaServer = new mta("87.238.173.138", 22005, "debugger", "98b803d4b4ec0916397d7f508cdc8964"); if ($mtaServer) { $resource = $mtaServer->getResource("admin-system"); $resource->call("remoteUnban", $username, $tusername); mysql_query("UPDATE accounts SET banned=0 WHERE id='" . $userid . "' LIMIT 1", $conn); echo "<p>'<strong>" . $tusername . "</strong>' is now unbanned.</p>"; } else { echo "<p>The server is currently unavailable to unban someone.</p>"; } } catch (Exception $e) { //echo $e; echo "<p>The server is currently unavailable to unban someone.</p>"; } } } ?> </div> </div>
$zip->open($zip_file["tmp_name"]); for ($i = 0; $i < $zip->numFiles; $i++) { $iname = $zip->getNameIndex($i); // var_dump($iname,"zip://".$zip_file["tmp_name"]."#".$iname, is_dir("zip://".$zip_file["tmp_name"]."#".$iname), pathinfo($iname)); echo "."; if (substr($iname, -1) == "/") { ftp_mkdir($ftp_conn, $folder_path . $iname); } else { ftp_put($ftp_conn, $folder_path . $iname, "zip://" . $zip_file["tmp_name"] . "#" . $iname, FTP_BINARY); } } $zip->close(); // Notify the server a new mta map was uploaded $returns = false; $mtaServer = new mta($mta_host, $http_port); try { $returns = $mtaServer->getResource("maptools")->call("newMap", $filename, $_SESSION['forumid'], $_SESSION['user']); } catch (Exception $e) { } $mta_error = $returns[0]; $status = $returns[1]; // Check the response from the mta server, if something is wrong then remove the folder again if (!$returns) { // Couldn't connect to mta $servermessage = "Could not connect with the MTA server, check if it is online and try again"; ftp_rdel($ftp_conn, $folder_path); } elseif (strlen($mta_error) > 1) { // MTA server reported an error $servermessage = "Error while loading map: " . $mta_error; ftp_rdel($ftp_conn, $folder_path); } else { // MTA server reported adding is ok, add map to database