if (!(buckys_is_admin() || buckys_is_moderator() || buckys_is_forum_admin($category['categoryID']) || buckys_is_forum_moderator($category['categoryID']))) {
         buckys_redirect('/forum/category.php?id=' . $categoryID, MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
     }
     BuckysReport::deleteObjects($_REQUEST['reportID']);
     buckys_redirect("/forum/moderator.php?id=" . $categoryID, MSG_REPORTED_OBJECT_REMOVED);
 } else {
     if ($_REQUEST['action'] == 'Approve') {
         //Check forum token
         if (!buckys_check_form_token('request')) {
             buckys_redirect('/forum/category.php?id=' . $categoryID, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
         }
         //Admin, Site Moderator, Category Admin and Category Moderator can't apply
         if (!(buckys_is_admin() || buckys_is_moderator() || buckys_is_forum_admin($category['categoryID']) || buckys_is_forum_moderator($category['categoryID']))) {
             buckys_redirect('/forum/category.php?id=' . $categoryID, MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
         }
         BuckysReport::approveObjects($_REQUEST['reportID']);
         buckys_redirect("/forum/moderator.php?id=" . $categoryID, MSG_REPORTED_OBJECT_APPROVED);
     } else {
         if ($_REQUEST['action'] == 'block-user') {
             $return = isset($_REQUEST['return']) ? base64_decode($_REQUEST['return']) : '/forum/category.php?id=' . $categoryID;
             //Check forum token
             if (!buckys_check_form_token('request')) {
                 buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
             }
             //Admin, Site Moderator, Category Admin and Category Moderator can't be blocked
             if (!(buckys_is_admin() || buckys_is_moderator() || buckys_is_forum_admin($category['categoryID']) || buckys_is_forum_moderator($category['categoryID']))) {
                 buckys_redirect($return, MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
             }
             $blockedUserID = buckys_escape_query_integer($_REQUEST['userID']);
             if ($blockedUserID == $userID) {
                 buckys_redirect($return, MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
示例#2
0
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);
            }
        }
    }
    exit;
}
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$totalCount = BuckysReport::getReportedObjectCount($reportType);
//Init Pagination Class
$pagination = new Pagination($totalCount, BuckysReport::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();