Ejemplo n.º 1
0
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("View Your Squads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
$squadObj = new Squad($mysqli);
$squadAppObj = new Basic($mysqli, "squadapps", "squadapp_id");
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    if ($squadObj->select($_POST['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], "acceptapps") && $squadAppObj->select($_POST['saID'])) {
        $squadInfo = $squadObj->get_info_filtered();
        $squadAppInfo = $squadAppObj->get_info();
        $squadRankList = $squadObj->getRankList();
        if ($squadAppInfo['squad_id'] == $_POST['sID'] && $squadAppInfo['status'] == 0 && count($squadRankList) > 1) {
            if ($_POST['action'] == "accept") {
                $squadRankKey = count($squadRankList) - 1;
                $newMemberSquadRank = $squadRankList[$squadRankKey];
                $squadAppObj->update(array("dateaction", "status", "squadmember_id"), array(time(), "1", $memberInfo['member_id']));
                $arrColumns = array("squad_id", "member_id", "squadrank_id", "datejoined");
                $arrValues = array($squadAppInfo['squad_id'], $squadAppInfo['member_id'], $newMemberSquadRank, time());
                $squadObj->objSquadMember->addNew($arrColumns, $arrValues);
                $intViewSquadsCID = $consoleObj->findConsoleIDByName("View Your Squads");
                $member->select($squadAppInfo['member_id']);
                $member->postNotification("Congratulations!  Your application for the squad <b>" . $squadInfo['name'] . "</b> has been approved.  View the Squads section of <a href='" . $MAIN_ROOT . "members'>My Account</a> to <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intViewSquadsCID . "'>View Your Squads</a>.");
                $mysqli->query("DELETE FROM " . $dbprefix . "squadinvites WHERE receiver_id = '" . $squadAppInfo['member_id'] . "'");
Ejemplo n.º 2
0
include_once "../../../classes/squad.php";
include_once "../../../classes/shoutbox.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("View Your Squads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    if ($squadObj->select($_GET['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], "postshoutbox")) {
        $squadInfo = $squadObj->get_info();
        $squadNewsObj = new Basic($mysqli, "squadnews", "squadnews_id");
        $arrColumns = array("member_id", "squad_id", "dateposted", "newspost", "newstype");
        $arrValues = array($memberInfo['member_id'], $squadInfo['squad_id'], time(), $_POST['message'], 3);
        $squadNewsObj->addNew($arrColumns, $arrValues);
        if ($squadObj->memberHasAccess($memberInfo['member_id'], "manageshoutbox")) {
            $blnManageShoutbox = true;
        }
    }
}
$squadMemberList = $squadObj->getMemberList();
$blnShowShoutBox = false;
if (in_array($memberInfo['member_id'], $squadMemberList) && $squadInfo['privateshoutbox'] == 1) {
    $blnShowShoutBox = true;
} elseif ($squadInfo['privateshoutbox'] == 0) {
Ejemplo n.º 3
0
$cID = $_GET['cID'];
$squadObj = new Squad($mysqli);
$counter = 0;
$dispSquadNames = "";
$arrSquads = $member->getSquadList();
if ($squadObj->getManageAllStatus()) {
    $arrSquads = array();
    $result = $mysqli->query("SELECT squad_id FROM " . $dbprefix . "squads ORDER BY name");
    while ($row = $result->fetch_assoc()) {
        $arrSquads[] = $row['squad_id'];
    }
}
$clickCounter = 0;
if (count($arrSquads) > 0) {
    foreach ($arrSquads as $squadID) {
        if ($squadObj->select($squadID)) {
            $intSquadMemberID = $squadObj->getSquadMemberID($memberInfo['member_id']);
            if ($squadObj->objSquadMember->select($intSquadMemberID) || $squadObj->getManageAllStatus()) {
                $squadMemberInfo = $squadObj->objSquadMember->get_info_filtered();
                if ($squadObj->objSquadRank->select($squadMemberInfo['squadrank_id']) || $squadObj->getManageAllStatus()) {
                    $squadRankInfo = $squadObj->objSquadRank->get_info_filtered();
                    $categoryCSS = "consoleCategory_clicked";
                    $hideoptions = "";
                    if ($counter > 0) {
                        $hideoptions = "style='display: none'";
                        $categoryCSS = "consoleCategory";
                    }
                    $counter++;
                    $squadInfo = $squadObj->get_info_filtered();
                    if ($_GET['select'] == $squadInfo['squad_id']) {
                        $clickCounter = $counter;
Ejemplo n.º 4
0
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../_setup.php";
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/squad.php";
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("View Your Squads");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$pID = "manageranks";
$squadObj = new Squad($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj) && $squadObj->select($_POST['sID']) && $squadObj->memberHasAccess($member->get_info("member_id"), $pID)) {
    $squadInfo = $squadObj->get_info_filtered();
    $memberInfo = $member->get_info_filtered();
    if ($squadObj->objSquadRank->select($_POST['rID'])) {
        $squadRankInfo = $squadObj->objSquadRank->get_info();
        $addTo = 1;
        if ($_POST['rDir'] == "up") {
            $addTo = -1;
        }
        if ($squadRankInfo['sortnum'] != 1 && $squadRankInfo['sortnum'] + $addTo != 1) {
            $newSortNum = $squadRankInfo['sortnum'] + $addTo;
            $result = $mysqli->query("SELECT * FROM " . $dbprefix . "squadranks WHERE squad_id = '" . $squadRankInfo['squad_id'] . "' AND sortnum = '" . $newSortNum . "'");
            $row = $result->fetch_assoc();
            $newSortNumRankID = $row['squadrank_id'];
            $arrColumns = array("sortnum");
            $arrValues = array($newSortNum);
Ejemplo n.º 5
0
         if ($rankID != "" && $member->objRank->select($rankID)) {
             $filterMembers = "('" . implode("','", $arrReceivers) . "')";
             $result = $mysqli->query("SELECT member_id FROM " . $dbprefix . "members WHERE rank_id = '" . $rankID . "' AND member_id NOT IN " . $filterMembers);
             while ($row = $result->fetch_assoc()) {
                 $arrReceivers[] = $row['member_id'];
                 $arrGroup[$row['member_id']] = array("rank", $rankID);
             }
         }
     }
 }
 // Check Squads
 $member->select($memberInfo['member_id']);
 $arrSquads = $member->getSquadList();
 if (count($_SESSION['btComposeList'][$pmSessionID]['squad']) > 0) {
     foreach ($_SESSION['btComposeList'][$pmSessionID]['squad'] as $squadID) {
         if ($squadID != "" && in_array($squadID, $arrSquads) && $squadObj->select($squadID)) {
             $filterMembers = "('" . implode("','", $arrReceivers) . "')";
             $result = $mysqli->query("SELECT member_id FROM " . $dbprefix . "squads_members WHERE squad_id = '" . $squadID . "' AND member_id NOT IN " . $filterMembers);
             while ($row = $result->fetch_assoc()) {
                 $arrReceivers[] = $row['member_id'];
                 $arrGroup[$row['member_id']] = array("squad", $squadID);
             }
         }
     }
 }
 // Check Tournaments
 $arrTournaments = $member->getTournamentList(true);
 if (count($_SESSION['btComposeList'][$pmSessionID]['tournament']) > 0) {
     foreach ($_SESSION['btComposeList'][$pmSessionID]['tournament'] as $tournamentID) {
         if ($tournamentID != "" && in_array($tournamentID, $arrTournaments) && $tournamentObj->select($tournamentID)) {
             $filterMembers = "('" . implode("','", $arrReceivers) . "')";
Ejemplo n.º 6
0
    exit;
} else {
    $memberInfo = $member->get_info();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
include_once $prevFolder . "classes/squad.php";
$cID = $_GET['cID'];
$squadObj = new Squad($mysqli);
$dispError = "";
$countErrors = 0;
if ($_POST['submit']) {
    // Check Squad
    if (!$squadObj->select($_POST['squad'])) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid squad!<br>";
    } else {
        $outstandingApps = $squadObj->getOutstandingApplications();
        if (in_array($memberInfo['member_id'], $outstandingApps)) {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You have already applied to this squad!  Please wait for a decision to be made before re-applying.<br>";
        }
    }
    if ($countErrors == 0) {
        $squadInfo = $squadObj->get_info_filtered();
        $squadAppObj = new Basic($mysqli, "squadapps", "squadapp_id");
        $arrColumns = array("member_id", "squad_id", "message", "applydate", "status");
        $arrValues = array($memberInfo['member_id'], $_POST['squad'], $_POST['message'], time(), 0);
        if ($squadAppObj->addNew($arrColumns, $arrValues)) {
Ejemplo n.º 7
0
$cID = $consoleObj->findConsoleIDByName("View Your Squads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
$pID = "manageshoutbox";
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    $squadNewsObj = new Basic($mysqli, "squadnews", "squadnews_id");
    if ($squadObj->select($_POST['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], "manageshoutbox") && $squadNewsObj->select($_POST['nID'])) {
        if ($_POST['submit']) {
            // Check Message
            if (trim($_POST['message']) == "") {
                $countErrors++;
                $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You may not make a blank shoutbox post.<br>";
            }
            if ($countErrors == 0) {
                $time = time();
                $arrColumns = array("newspost", "lasteditmember_id", "lasteditdate");
                $arrValues = array($_POST['message'], $memberInfo['member_id'], $time);
                if ($squadNewsObj->update($arrColumns, $arrValues)) {
                    $_POST['cancel'] = true;
                } else {
                    $countErrors++;
                    $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to database! Please contact the website administrator.<br>";
Ejemplo n.º 8
0
 */
include_once "../../../_setup.php";
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/tournament.php";
include_once "../../../classes/squad.php";
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Tournaments");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$countErrors = 0;
$dispError = "";
$tournamentObj = new Tournament($mysqli);
$squadObj = new Squad($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $squadObj->select($_POST['squadID']) && $tournamentObj->objTeam->select($_POST['teamID']) && $member->hasAccess($consoleObj)) {
    $memberInfo = $member->get_info_filtered();
    $teamInfo = $tournamentObj->objTeam->get_info_filtered();
    $tournamentObj->select($teamInfo['tournament_id']);
    $tournamentInfo = $tournamentObj->get_info();
    if ($tournamentInfo['member_id'] == $memberInfo['member_id'] || $memberInfo['rank_id'] == 1 || $tournamentObj->isManager($memberInfo['member_id'])) {
        $arrSquadMembers = $squadObj->getMemberListSorted();
        echo "\n\t\t\t<input type='hidden' value='" . $squadObj->get_info_filtered("name") . "' id='squadName'>\n\t\t\t<div id='squadMemberList' style='max-height: 200px; overflow-y: auto'>\n\t\t\t<table class='formTable' style='width: 95%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td></td>\n\t\t\t\t\t<td class='main' align='center'>\n\t\t\t\t\t\t<a href='javascript:void(0)' id='checkAllLink'>Check All</a>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t";
        foreach ($arrSquadMembers as $value) {
            if ($member->select($value)) {
                $tempMemberInfo = $member->get_info_filtered();
                echo "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>" . $tempMemberInfo['username'] . "</td>\n\t\t\t\t\t\t<td class='main' align='center'><input type='checkbox' value='" . $tempMemberInfo['member_id'] . "'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t";
            }
        }
        $member->select($memberInfo['member_id']);
        echo "\n\t\t\t</table>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\n\t\t\t\tvar intCheckAll = 1;\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\$('#checkAllLink').click(function() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#squadMemberList input[type=checkbox]').each(function() {\n\t\t\t\t\t\t\tif(intCheckAll == 1) {\n\t\t\t\t\t\t\t\t\$(this).attr('checked', true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\$(this).attr('checked', false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(intCheckAll == 1) {\n\t\t\t\t\t\t\tintCheckAll = 0;\n\t\t\t\t\t\t\t\$('#checkAllLink').html('Uncheck All');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tintCheckAll = 1;\n\t\t\t\t\t\t\t\$('#checkAllLink').html('Check All');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t</script>\n\t\t\t\n\t\t";
Ejemplo n.º 9
0
include_once "../../../classes/squad.php";
include_once "../../../classes/shoutbox.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("View Your Squads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    if ($squadObj->select($_POST['sID'])) {
        $squadInfo = $squadObj->get_info();
        if ($squadObj->memberHasAccess($memberInfo['member_id'], "manageshoutbox")) {
            $blnManageShoutbox = true;
        }
    }
}
$squadMemberList = $squadObj->getMemberList();
$blnShowShoutBox = false;
if (in_array($memberInfo['member_id'], $squadMemberList) && $squadInfo['privateshoutbox'] == 1) {
    $blnShowShoutBox = true;
} elseif ($squadInfo['privateshoutbox'] == 0) {
    $blnShowShoutBox = true;
}
if ($blnShowShoutBox) {
    $shoutboxObj = new Shoutbox($mysqli, "squadnews", "squadnews_id");
Ejemplo n.º 10
0
$consoleTitle = $consoleInfo['pagetitle'];
$squadObj = new Squad($mysqli);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
$pID = strtolower($_GET['pID']);
if ($pID == "viewapps") {
    $pID = "acceptapps";
}
$sID = $_GET['sID'];
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    $blnShowPage = false;
    // Check Squad ID
    if ($squadObj->select($_GET['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], $pID) || $blnManageAllSquads) {
        $blnShowPage = true;
    } elseif ($squadObj->select($_GET['sID']) && !$squadObj->memberHasAccess($memberInfo['member_id'], $pID)) {
        $blnShowPage = false;
    } else {
        echo "\n\t\t\t<script type='text/javascript'>\n\t\t\t\twindow.location = '" . $MAIN_ROOT . "'\n\t\t\t</script>\n\t\t";
        exit;
    }
    if ($pID == "closesquad") {
        if ($memberInfo['member_id'] == $squadObj->get_info("member_id") || $blnManageAllSquads) {
            $blnShowPage = true;
        }
    } elseif ($pID == "leavesquad") {
        if ($memberInfo['member_id'] != $squadObj->get_info("member_id")) {
            $blnShowPage = true;
        }
Ejemplo n.º 11
0
include_once "../../../_setup.php";
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/squad.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("View Your Squads");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
$pID = "managenews";
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    $squadNewsObj = new Basic($mysqli, "squadnews", "squadnews_id");
    if ($squadObj->select($_POST['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], $pID) && $squadNewsObj->select($_POST['nID'])) {
        if ($_POST['confirm'] == 1) {
            $squadNewsObj->delete();
            $_POST['pID'] = $pID;
            include "newslist.php";
        } else {
            echo "\n\t\t\t\t<p align='center' class='main'>Are you sure you want to delete the news post?</p>\n\t\t\t";
        }
    }
}
Ejemplo n.º 12
0
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    $counter = 0;
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "squadinvites WHERE receiver_id = '" . $memberInfo['member_id'] . "' AND status = '0' ORDER BY datesent DESC");
    while ($row = $result->fetch_assoc()) {
        $member->select($row['sender_id']);
        $squadMemberInfo = $member->get_info_filtered();
        $squadObj->select($row['squad_id']);
        $squadInfo = $squadObj->get_info_filtered();
        if ($squadMemberInfo['avatar'] == "") {
            $squadMemberInfo['avatar'] = $MAIN_ROOT . "themes/" . $THEME . "/images/defaultavatar.png";
        } else {
            $squadMemberInfo['avatar'] = $MAIN_ROOT . $squadMemberInfo['avatar'];
        }
        if (trim($row['message']) == "") {
            $row['message'] = "None";
        }
        $squadObj->objSquadRank->select($row['startingrank_id']);
        echo "\n\t\t\t<div class='newsDiv'>\n\t\t\t\n\t\t\t\t<div class='postInfo'>\n\t\t\t\t\t<div id='newsPostAvatar' style='float: left'><img src='" . $squadMemberInfo['avatar'] . "' class='avatarImg'></div>\n\t\t\t\t\t<div id='newsPostInfo' style='float: left; margin-left: 15px'>\n\t\t\t\t\t\tFrom: " . $member->getMemberLink() . " - " . getPreciseTime($row['datesent']) . "<br>\n\t\t\t\t\t\tSquad: <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $row['squad_id'] . "'>" . $squadInfo['name'] . "</a></b><br>\n\t\t\t\t\t\tStarting Rank: " . $squadObj->objSquadRank->get_info_filtered("name") . "\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style='clear: both'></div>\n\t\t\t\t</div>\n\t\t\t\t<br>\n\t\t\t\t<div class='dottedLine' style='margin-top: 5px'></div>\n\t\t\t\t<div class='postMessage'>\n\t\t\t\t\t<b>Message:</b><br><br>\n\t\t\t\t\t<div style='padding-left: 15px'>" . nl2br(parseBBCode(filterText($row['message']))) . "</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='dottedLine' style='margin-top: 5px; margin-bottom: 5px'></div>\n\t\t\t\t<p style='padding: 0px; margin: 0px' align='right'><b><a href='javascript:void(0)' onclick=\"inviteClicked('" . $row['squadinvite_id'] . "', 'accept')\">ACCEPT</a> | <a href='javascript:void(0)' onclick=\"inviteClicked('" . $row['squadinvite_id'] . "', 'decline')\">DECLINE</a></b></p>\n\t\t\t</div>\n\n\t\t";
        $counter++;
    }
    if ($counter == 0) {
        echo "\n\t\t\t<div class='shadedBox' style='width: 300px; margin-top: 50px; margin-left: auto; margin-right: auto; font-style: italic'>\n\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\tYou currently have no squad invitiations!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<br>\n\t\t";
Ejemplo n.º 13
0
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("View Squad Invitations");
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
$squadInviteObj = new Basic($mysqli, "squadinvites", "squadinvite_id");
// Check Login
$LOGIN_FAIL = true;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj) && $squadInviteObj->select($_POST['siID'])) {
    $memberInfo = $member->get_info();
    $memberLink = $member->getMemberLink();
    $squadInviteInfo = $squadInviteObj->get_info();
    $squadObj->select($squadInviteInfo['squad_id']);
    $squadInfo = $squadObj->get_info_filtered();
    $squadMemberList = $squadObj->getMemberList();
    if ($squadInviteInfo['receiver_id'] == $memberInfo['member_id'] && $squadInviteInfo['status'] == 0 && !in_array($memberInfo['member_id'], $squadMemberList)) {
        if ($_POST['action'] == "accept") {
            $arrRankList = $squadObj->getRankList();
            if (!$squadObj->objSquadRank->select($squadInviteInfo['startingrank_id']) && count($arrRankList) > 1) {
                $rankKey = count($arrRankList) - 1;
                $squadInviteInfo['startingrank_id'] = $arrRankList[$rankKey];
            } elseif (!$squadObj->objSquadRank->select($squadInviteInfo['startingrank_id']) && count($arrRankList) <= 1) {
                $member->select($squadInfo['member_id']);
                $member->postNotification("There are currently members in your squad, <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadInfo['squad_id'] . "'>" . $squadInfo['name'] . "</a></b> without ranks!");
                $member->select($memberInfo['member_id']);
            }
            $squadInviteObj->update(array("dateaction", "status"), array(time(), "1"));
            $arrColumns = array("squad_id", "member_id", "squadrank_id", "datejoined");
Ejemplo n.º 14
0
$prevFolder = "../";
include $prevFolder . "_setup.php";
// Classes needed for profile.php
include_once $prevFolder . "classes/squad.php";
include_once $prevFolder . "classes/member.php";
include_once $prevFolder . "classes/shoutbox.php";
include_once $prevFolder . "classes/consoleoption.php";
$squadObj = new Squad($mysqli);
$consoleObj = new ConsoleOption($mysqli);
if (!isset($member)) {
    $member = new Member($mysqli);
    if (isset($_SESSION['btUsername']) and isset($_SESSION['btPassword']) && $member->select($_SESSION['btUsername']) && $member->authorizeLogin($_SESSION['btPassword'])) {
        $memberInfo = $member->get_info_filtered();
    }
}
if (!$squadObj->select($_GET['sID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "';</script>");
} else {
    $squadInfo = $squadObj->get_info_filtered();
}
$ipbanObj = new Basic($mysqli, "ipban", "ipaddress");
if ($ipbanObj->select($IP_ADDRESS, false)) {
    $ipbanInfo = $ipbanObj->get_info();
    if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) {
        die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>");
    } else {
        $ipbanObj->delete();
    }
}
// Start Page
$PAGE_NAME = $squadInfo['name'] . " - ";