Exemplo n.º 1
0
     $countErrors++;
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid team in the match up.<br>";
 }
 // Check Scores
 if ($_POST['team1score'] != "" && !is_numeric($_POST['team1score']) || $_POST['team2score'] != "" && !is_numeric($_POST['team2score'])) {
     $countErrors++;
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Scores must be a numeric value.<br>";
 }
 // Check Outcome
 if ($_POST['outcome'] != 0 && $_POST['outcome'] != 1 && $_POST['outcome'] != 2) {
     $countErrors++;
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid outcome.<br>";
 }
 // Check Replay Upload
 if ($_FILES['uploadreplay']['name'] != "") {
     $uploadReplayObj = new BTUpload($_FILES['uploadreplay'], "replay_", "../../downloads/replays/", array(".zip"));
     if (!$uploadReplayObj->uploadFile()) {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload the replay. Please make sure the file extension is .zip and that the file size is not too big.<br>";
     } else {
         $matchReplayURL = $MAIN_ROOT . "downloads/replays/" . $uploadReplayObj->getUploadedFileName();
     }
 } else {
     $matchReplayURL = $_POST['replayurl'];
 }
 if ($countErrors == 0) {
     // Swap players if team 2 is changing
     if ($matchInfo['team2_id'] != $_POST['playertwo'] && $_POST['playertwo'] != 0) {
         $playerTwoMatch = $tournamentObj->getMatches($matchInfo['round'], $_POST['playertwo']);
         $tournamentObj->objMatch->select($playerTwoMatch[0]);
         $playerTwoMatchInfo = $tournamentObj->objMatch->get_info();
Exemplo n.º 2
0
     if (!is_numeric($_POST['autodays']) or is_numeric($_POST['autodays']) and $_POST['autodays'] < 0) {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Auto days must either be blank or a positive numeric value.<br>";
     }
 }
 if ($_POST['autodisable'] != "") {
     if (!is_numeric($_POST['autodisable']) or is_numeric($_POST['autodisable']) and $_POST['autodisable'] < 0) {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Auto disable must either be blank or a positive numeric value.<br>";
     }
 }
 // If everything is ok, try uploading the image
 if ($countErrors == 0) {
     // Check Rank Image File
     if ($_FILES['rankimagefile']['name'] != "") {
         $uploadFile = new BTUpload($_FILES['rankimagefile'], "rank_", "../images/ranks/", array(".jpg", ".png", ".gif", ".bmp"));
         if (!$uploadFile->uploadFile()) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload rank image file.  Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>";
         } else {
             $rankImgURL = "images/ranks/" . $uploadFile->getUploadedFileName();
         }
     } else {
         if (trim($_POST['rankimageurl']) == "") {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must include a rank image.<br>";
         } else {
             $rankImgURL = $_POST['rankimageurl'];
         }
     }
 }
Exemplo n.º 3
0
     if (!$gameObj->select($_POST['gameorder'])) {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> The selected an invalid display order. (game position)<br>";
     } else {
         // Game was selected make some room for the new game and get a new ordernum
         $intGameOrderNum = $gameObj->makeRoom($_POST['beforeafter']);
         if (!is_numeric($intGameOrderNum)) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> The selected an invalid display order. (game position)<br>";
         }
     }
 }
 if ($countErrors == 0) {
     // No Errors! Check game image, if it needs to be uploaded, try uploading.
     if ($_FILES['gameimagefile']['name'] != "") {
         $btUploadObj = new BTUpload($_FILES['gameimagefile'], "game_", "../images/gamesplayed/", array(".jpg", ".png", ".bmp", ".gif"));
         if (!$btUploadObj->uploadFile()) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload games image file.  Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>";
         } else {
             $gameImageURL = "images/gamesplayed/" . $btUploadObj->getUploadedFileName();
         }
     } elseif (trim($_POST['gameimageurl']) != "") {
         $gameImageURL = $_POST['gameimageurl'];
     } else {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must include an image for the game.<br>";
     }
 }
 if ($countErrors == 0) {
     // No errors after adding the image. Add game to database.
Exemplo n.º 4
0
     $countErrors++;
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid access type.<br>";
 }
 if ($_POST['hidecategory'] != "1") {
     $_POST['hidecategory'] = 0;
 }
 if ($_POST['headertype'] == "customcode") {
     $headerImageURL = $_POST['headercustomcode'];
 } elseif ($_POST['headertype'] == "customformat") {
     $headerImageURL = $_POST['wysiwygHTML'];
 }
 if ($countErrors == 0) {
     if ($_POST['headertype'] == "image" && $_FILES['headerimagefile']['name'] != "") {
         $btUploadObj = new BTUpload($_FILES['headerimagefile'], "menuheader_", "../images/menu/", array(".jpg", ".png", ".bmp", ".gif"));
     } elseif ($_POST['headertype'] == "image") {
         $btUploadObj = new BTUpload($_POST['headerimageurl'], "menuheader_", "../images/menu/", array(".jpg", ".png", ".bmp", ".gif"), 4, true);
     }
     if ($_POST['headertype'] == "image" && $btUploadObj->uploadFile()) {
         $headerImageURL = "images/menu/" . $btUploadObj->getUploadedFileName();
     } elseif ($_POST['headertype'] == "image") {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload selected image.  Make sure it's the correct file extension and not too big.<br>";
     }
 }
 if ($countErrors == 0) {
     $arrColumns = array("section", "name", "sortnum", "headertype", "headercode", "accesstype", "hide");
     $arrValues = array($_POST['section'], $_POST['categoryname'], $intNewOrderNum, $_POST['headertype'], $headerImageURL, $_POST['accesstype'], $_POST['hidecategory']);
     if ($menuCatObj->addNew($arrColumns, $arrValues)) {
         $menuCatInfo = $menuCatObj->get_info_filtered();
         echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully Added New Menu Category: <b>" . $menuCatInfo['name'] . "</b>!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Add New Menu Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t";
     }
Exemplo n.º 5
0
     $result = $mysqli->query("SELECT * FROM " . $dbprefix . "rankcategory ORDER BY ordernum");
     if ($result->num_rows > 0) {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You have selected an invalid category order (category).<br>";
     } else {
         $intNewCatOrderNum = 1;
     }
 }
 $strCatImageURL = "";
 // Check Image
 if (isset($_POST['useimage']) && $_POST['useimage'] == 1) {
     // Use Image Selected, check for no errors
     if ($countErrors == 0) {
         if ($_FILES['catimagefile']['name'] != "") {
             // Image File Selected.... Upload it
             $uploadFile = new BTUpload($_FILES['catimagefile'], "rankcat_", "../images/ranks/", array(".jpg", ".png", ".gif", ".bmp"));
             if (!$uploadFile->uploadFile()) {
                 $countErrors++;
                 $dispError .= "<b>&middot;</b> Unable to upload category image file.  Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>";
             } else {
                 $strCatImageURL = "images/ranks/" . $uploadFile->getUploadedFileName();
             }
         } elseif ($_POST['catimageurl'] != "") {
             $strCatImageURL = $_POST['catimageurl'];
         } else {
             $strCatImageURL = $rankCatInfo['imageurl'];
         }
     }
     if ($strCatImageURL == "") {
         $_POST['useimage'] = 0;
     }
Exemplo n.º 6
0
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid display order.<br>";
     $countErrors++;
 }
 $statusImageURL = "";
 if ($countErrors == 0) {
     // If no errors, check for image upload and try to upload the image
     if ($_FILES['statusimagefile']['name'] != "") {
         $uploadImg = new BTUpload($_FILES['statusimagefile'], "status_", "../images/diplomacy/", array(".jpg", ".png", ".gif", ".bmp"));
         if (!$uploadImg->uploadFile()) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload status image. Please make sure the file size is not too big and it has an acceptable file extension.<br>";
         } else {
             $statusImageURL = "images/diplomacy/" . $uploadImg->getUploadedFileName();
         }
     } else {
         $uploadImg = new BTUpload($_POST['statusimageurl'], "status_", "../images/diplomacy/", array(".jpg", ".png", ".gif", ".bmp"), 4, true);
         if (!$uploadImg->uploadFile()) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to download status image from remote url. You may need to first download the image and upload normally.<br>";
         } else {
             $statusImageURL = "images/diplomacy/" . $uploadImg->getUploadedFileName();
         }
         //$statusImageURL = $_POST['statusimageurl'];
     }
     // If there are still no errors after uploading the image, add to db
     if ($countErrors == 0) {
         $arrColumns = array("name", "imageurl", "imagewidth", "imageheight", "ordernum");
         $arrValues = array($_POST['statusname'], $statusImageURL, $_POST['imagewidth'], $_POST['imageheight'], $intNewOrderNum);
         if ($diplomacyStatusObj->addNew($arrColumns, $arrValues)) {
             echo "\n\t\t\t\t\n\t\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\tSuccessfully added the " . $diplomacyStatusObj->get_info_filtered("name") . " status to the diplomacy page!\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\tpopupDialog('Add New Diplomacy Status', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t";
             $member->logAction("Added the " . $_POST['statusname'] . " status to the diplomacy page.");
Exemplo n.º 7
0
    $consoleObj->select($cID);
    $squadObj->select($sID);
    if (!$member->hasAccess($consoleObj) || !$squadObj->memberHasAccess($memberInfo['member_id'], "editprofile")) {
        exit;
    }
}
include_once "../../classes/btupload.php";
echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumbTitle').html(\"Edit Squad Profile\");\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&select=" . $squadInfo['squad_id'] . "'>" . $consoleTitle . "</a> > <b>" . $squadInfo['name'] . ":</b> Edit Squad Profile\");\n});\n</script>\n";
if ($_POST['submit']) {
    // Check Squad Name
    if (trim($_POST['squadname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a squad name.<br>";
    }
    if ($_FILES['uploadlogo']['name'] != "") {
        $uploadLogoObj = new BTUpload($_FILES['uploadlogo'], "squad_", "../../images/squads/", array(".png", ".jpg", ".gif", ".bmp"));
        if (!$uploadLogoObj->uploadFile()) {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload the squad logo. Please make sure the file extension is either .jpg, .png, .gif or .bmp and that the file size is not too big.<br>";
        } else {
            $logoImageURL = $MAIN_ROOT . "images/squads/" . $uploadLogoObj->getUploadedFileName();
        }
    } else {
        $logoImageURL = $_POST['logourl'];
    }
    if ($countErrors == 0) {
        if ($_POST['recruiting'] != 0) {
            $_POST['recruiting'] = 1;
        }
        if ($_POST['shoutbox'] != 0) {
            $_POST['shoutbox'] = 1;
Exemplo n.º 8
0
     $adminKeyFails = $intMaxAttempts - $countFails;
     $failbanObj->addNew(array("ipaddress", "pagename"), array($IP_ADDRESS, "editconsoleoption"));
     if ($adminKeyFails <= 0) {
         $ipbanObj->set_tableKey("ipban_id");
         $ipbanObj->addNew(array("ipaddress"), array($IP_ADDRESS));
         $banMessage = "You have been permanently banned!  If you are the true website admin, you will be able to unban yourself.  If not... GTFO!";
         echo "\n\t\t\t<div id='acoBan' style='display: none'><p align='center'>" . $banMessage . "</p></div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\t\$('#acoBan').dialog({\n\t\t\t\t\t\ttitle: 'Banned!',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbeforeClose: function() {\n\t\t\t\t\t\t\twindow.location = '" . $MAIN_ROOT . "banned.php';\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\t\$('.ui-dialog :button').blur();\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t\n\t\t\t";
     }
     $countErrors++;
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You entered an invalid admin key.  Please check the config file for the correct admin key.  You have " . $adminKeyFails . " more trys before being IP Banned. " . $IP_ADDRESS . "<br>";
 }
 $consoleFileURL = "";
 if ($countErrors == 0 && $_FILES['consolefile']['name'] != "") {
     // No Errors Try uploading Console File
     $newFileName = strtolower(str_replace(" ", "", $_POST['pagetitle'])) . "_";
     $btUpload = new BTUpload($_FILES['consolefile'], $newFileName, "include/customconsole/", array(".php"));
     if ($btUpload->uploadFile()) {
         $consoleFileURL = "customconsole/" . $btUpload->getUploadedFileName();
     } else {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to upload console option.  Please make sure the filesize is not too big and filetype is php.<br>";
     }
 }
 if ($_POST['hideoption'] != 1) {
     $_POST['hideoption'] = 0;
 }
 if ($countErrors == 0) {
     // Still no errors after Uploading ---> Update DB
     $consoleObj->select($_GET['cnID']);
     $arrColumns = array("consolecategory_id", "pagetitle", "sortnum", "hide");
     $arrValues = array($_POST['consolecat'], $_POST['pagetitle'], $intNewSortNum, $_POST['hideoption']);