Example #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'] . "'");
Example #2
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);
Example #3
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) {
Example #4
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>";
Example #5
0
// 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");
    $shoutboxObj->strDivID = "squadsShoutbox";
    $shoutboxObj->intDispWidth = 205;
Example #6
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;
        }
Example #7
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";
        }
    }
}
Example #8
0
$counter = 0;
$blnPost = false;
$blnManageShoutbox = false;
$blnManageNewsPost = false;
foreach ($arrSquadMembers as $key => $sortnum) {
    // $key = member_id
    $squadMemberID = $squadObj->getSquadMemberID($key);
    $squadObj->objSquadMember->select($squadMemberID);
    $squadMemberInfo = $squadObj->objSquadMember->get_info();
    $squadObj->objSquadRank->select($squadMemberInfo['squadrank_id']);
    $squadRankInfo = $squadObj->objSquadRank->get_info_filtered();
    $member->select($key);
    $dispMemberLink = $member->getMemberLink();
    // Check if squad member is looking at the profile page.
    // See if squad member has any squad privileges
    if ($memberInfo['member_id'] == $squadMemberInfo['member_id'] && $squadObj->memberHasAccess($memberInfo['member_id'], "postshoutbox")) {
        $blnPost = true;
        if ($squadObj->memberHasAccess($memberInfo['member_id'], "managenews")) {
            $blnManageNewsPost = true;
        }
        if ($squadObj->memberHasAccess($memberInfo['member_id'], "manageshoutbox")) {
            $blnManageShoutbox = true;
        }
    }
    if (substr($member->get_info_filtered("profilepic"), 0, 4) == "http") {
        $squadMemberProfilePic = $member->get_info_filtered("profilepic");
    } else {
        $squadMemberProfilePic = $MAIN_ROOT . $member->get_info_filtered("profilepic");
    }
    if ($squadMemberProfilePic == $MAIN_ROOT) {
        $squadMemberProfilePic = $MAIN_ROOT . "themes/" . $THEME . "/images/defaultprofile.png";