/** * Check that the current user is trade moderator */ function buckys_is_trade_moderator() { global $TNB_GLOBALS; if (!buckys_check_user_acl(USER_ACL_MODERATOR)) { return false; } if (!BuckysModerator::isModerator($TNB_GLOBALS['user']['userID'])) { return false; } return true; }
?> ">Send Friend Request</a> <br/> <?php } } } //Show Message ?> <a href="/messages_compose.php?to=<?php echo $profileID; ?> ">Send Message</a> <br/> <?php //For Community Moderator if (BuckysModerator::isModerator($userID) && !BuckysBanUser::isBannedUser($profileID)) { ?> <a href="/profile.php?action=ban-user&userID=<?php echo $profileID; ?> " onclick="return confirm('<?php echo MSG_ARE_YOU_SURE_WANT_TO_BAN_THIS_USER; ?> ')">Ban User</a> <br/> <?php } //For Administrator if (buckys_check_user_acl(USER_ACL_ADMINISTRATOR)) { ?>
<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; if (!buckys_check_user_acl(USER_ACL_ADMINISTRATOR) && !BuckysModerator::isModerator($TNB_GLOBALS['user']['userID'])) { buckys_redirect('/forum', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } //Process Post Actions if (isset($_POST['action'])) { $action = $_POST['action']; //Approve Topics if ($action == 'approve-topic') { //Getting Ids $topicIds = isset($_POST['tid']) ? $_POST['tid'] : null; if (!$topicIds) { buckys_redirect('/forum/pending_topcis.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $result = BuckysForumTopic::approvePendingTopics($topicIds); if ($result === true) { buckys_redirect('/forum/pending_topics.php', MSG_TOPIC_APPROVED_SUCCESSFULLY); } else { buckys_redirect('/forum/pending_topics.php', $result, MSG_TYPE_ERROR); } } else { if ($action == 'delete-topic') { // Delete Pending Topics //Getting Ids $topicIds = isset($_POST['tid']) ? $_POST['tid'] : null; if (!$topicIds) { buckys_redirect('/forum/pending_topcis.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $result = BuckysForumTopic::deletePendingTopics($topicIds);
?> <header id="main_header"> <div id="rightAlignLinks"> <a href="/trade/additem.php" class="headerLinks">Add Item</a> | <a href="/trade/available.php" class="headerLinks">Control Panel</a> </div> <a href="index.php"><img src="/images/mainLogoTrade.png"></a> </header> <?php break; case 'forum': ?> <header id="main_header"> <div id="rightAlignLinks"> <?php if (buckys_check_user_acl(USER_ACL_ADMINISTRATOR) || BuckysModerator::isModerator($BUCKYS_GLOBALS['user']['userID'], MODERATOR_FOR_FORUM)) { ?> <?php $pendingTopics = BuckysForumTopic::getTotalNumOfTopics('pending'); $pendingReplies = BuckysForumReply::getTotalNumOfReplies(null, 'pending'); ?> <?php if ($pendingTopics > 0) { ?> <a href="/forum/pending_topics.php" class="headerLinksBold">Pending Topics (<?php echo $pendingTopics; ?> )</a> | <?php }
$moderatorType = null; foreach ($BUCKYS_GLOBALS['reportObjectTypes'] as $mtype => $row) { if (in_array($reportType, $row)) { $moderatorType = $mtype; } } if ($moderatorType == null) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } if ($moderatorType == MODERATOR_FOR_COMMUNITY && !BuckysModerator::isModerator($BUCKYS_GLOBALS['user']['userID'], MODERATOR_FOR_COMMUNITY)) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } if ($moderatorType == MODERATOR_FOR_FORUM && !BuckysModerator::isModerator($BUCKYS_GLOBALS['user']['userID'], MODERATOR_FOR_FORUM)) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } if ($moderatorType == MODERATOR_FOR_TRADE && !BuckysModerator::isModerator($BUCKYS_GLOBALS['user']['userID'], MODERATOR_FOR_TRADE)) { buckys_redirect('/index.php', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR); } if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'delete-objects') { BuckysReport::deleteObjects($_REQUEST['reportID'], $reportType, $moderatorType); buckys_redirect('/reported.php?type=' . $reportType, MSG_REPORTED_OBJECT_REMOVED); } else { if ($_REQUEST['action'] == 'approve-objects') { BuckysReport::approveObjects($_REQUEST['reportID'], $reportType, $moderatorType); buckys_redirect('/reported.php?type=' . $reportType, MSG_REPORTED_OBJECT_APPROVED); } else { if ($_REQUEST['action'] == 'ban-users') { BuckysReport::banUsers($_REQUEST['reportID'], $reportType, $moderatorType); buckys_redirect('/reported.php?type=' . $reportType, MSG_BAN_USERS); }
echo base64_encode("/profile.php?user="******">Send Friend Request</a> <br/> <?php } } } //Show Message ?> <a href="/messages_compose.php?to=<?php echo $profileID; ?> ">Send Message</a> <br/> <?php //For Community Moderator if (BuckysModerator::isModerator($userID, MODERATOR_FOR_COMMUNITY) && !BuckysBanUser::isBannedUser($profileID)) { ?> <a href="/profile.php?action=ban-user&userID=<?php echo $profileID; ?> " onclick="return confirm('<?php echo MSG_ARE_YOU_SURE_WANT_TO_BAN_THIS_USER; ?> ')">Banned User</a><br /> <?php } //For Administrator if (buckys_check_user_acl(USER_ACL_ADMINISTRATOR)) { ?> <a href="/banned_users.php?action=deletebyid&userID=<?php echo $profileID;
">Reported Messages<?php echo $reportedMessages > 0 ? ' (' . $reportedMessages . ')' : ''; ?> </a><br /> <?php } ?> <?php if (BuckysModerator::isModerator($userID, MODERATOR_FOR_TRADE)) { ?> <!-- Trade Moderator Links --> <?php } ?> <?php if (BuckysModerator::isModerator($userID, MODERATOR_FOR_FORUM)) { ?> <?php $reportedTopics = BuckysReport::getReportedObjectCount('topic'); $reportedReplies = BuckysReport::getReportedObjectCount('reply'); ?> <a href="/reported.php?type=topic" class="accountLinks">Moderator Panel</a> <a href="/reported.php?type=topic" class="accountSubLinks<?php echo $reportedTopics > 0 ? 'Bold' : ''; ?> ">Reported Topics<?php echo $reportedTopics > 0 ? ' (' . $reportedTopics . ')' : ''; ?> </a><br /> <a href="/reported.php?type=reply" class="accountSubLinks<?php echo $reportedReplies > 0 ? 'Bold' : '';
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; //Getting Current User ID $userID = buckys_is_logged_in(); //Process Some Actions if (isset($_GET['action']) && $_GET['action'] == 'ban-user') { if (!BuckysModerator::isModerator($userID)) { die(MSG_PERMISSION_DENIED); } if (!isset($_GET['userID']) || !BuckysUser::checkUserID($userID)) { buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } //Ban User BuckysBanUser::banUser($_GET['userID']); buckys_redirect('/index.php', MSG_BAN_USER); exit; } //Getting User ID from Parameter $profileID = buckys_escape_query_integer(isset($_GET['user']) ? $_GET['user'] : null); //If the parameter is null, goto homepage if (!$profileID) { buckys_redirect('/index.php'); } //Getting UserData from Id $userData = BuckysUser::getUserData($profileID); //Goto Homepage if the userID is not correct if (!buckys_not_null($userData) || !BuckysUser::checkUserID($profileID, true) && !buckys_check_user_acl(USER_ACL_ADMINISTRATOR)) { buckys_redirect('/index.php'); } $postType = isset($_GET['type']) ? $_GET['type'] : 'all';
<?php require dirname(__FILE__) . '/includes/bootstrap.php'; //Getting Current User ID $userID = buckys_is_logged_in(); //Process Some Actions if (isset($_GET['action']) && $_GET['action'] == 'ban-user') { if (!BuckysModerator::isModerator($userID, MODERATOR_FOR_COMMUNITY)) { die(MSG_PERMISSION_DENIED); } if (!isset($_GET['userID']) || !BuckysUser::checkUserID($userID)) { buckys_redirect('/index.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } //Ban User BuckysBanUser::banUser($_GET['userID']); buckys_redirect('/index.php', MSG_BAN_USER); exit; } //Getting User ID from Parameter $profileID = isset($_GET['user']) ? intval($_GET['user']) : 0; //If the parameter is null, goto homepage if (!$profileID) { buckys_redirect('/index.php'); } //Getting UserData from Id $userData = BuckysUser::getUserData($profileID); //Goto Homepage if the userID is not correct if (!buckys_not_null($userData) || !BuckysUser::checkUserID($profileID, true) && !buckys_check_user_acl(USER_ACL_ADMINISTRATOR)) { buckys_redirect('/index.php'); } //if logged user can see all resources of the current user