示例#1
0
文件: Groups.php 项目: norv/EosAlpha
function Groups()
{
    global $context, $txt, $scripturl, $sourcedir, $user_info, $modSettings;
    // The sub-actions that we can do. Format "Function Name, Mod Bar Index if appropriate".
    $subActions = array('index' => array('GroupList', 'view_groups'), 'members' => array('MembergroupMembers', 'view_groups'), 'requests' => array('GroupRequests', 'group_requests'));
    if (!isset($modSettings['groupColorsInline'])) {
        require_once $sourcedir . '/lib/Subs-Membergroups.php';
        regenerateColorStyle();
    }
    // Default to sub action 'index' or 'settings' depending on permissions.
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'index';
    // Get the template stuff up and running.
    loadLanguage('ManageMembers');
    loadLanguage('ModerationCenter');
    if (isset($_REQUEST['action']) && $_REQUEST['action'] === 'admin' || $_REQUEST['action'] === 'groups') {
        loadAdminTemplate('ManageMembergroups');
    }
    // If we can see the moderation center, and this has a mod bar entry, add the mod center bar.
    if ($_REQUEST['action'] != 'moderate' && (allowedTo('access_mod_center') || $user_info['mod_cache']['bq'] != '0=1' || $user_info['mod_cache']['gq'] != '0=1' || allowedTo('manage_membergroups'))) {
        if (isset($_REQUEST['group'])) {
            redirectexit(URL::parse('?action=moderate;area=viewgroups;sa=members;group=' . $_REQUEST['group']));
        } else {
            if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'requests' && isset($_POST[$context['session_var']])) {
                require_once $sourcedir . '/ModerationCenter.php';
                $_GET['area'] = $_REQUEST['sa'] == 'requests' ? 'groups' : 'viewgroups';
                ModerationMain(true);
            } else {
                redirectexit(URL::parse('?action=moderate;area=viewgroups'));
            }
        }
        //require_once($sourcedir . '/ModerationCenter.php');
        //$_GET['area'] = $_REQUEST['sa'] == 'requests' ? 'groups' : 'viewgroups';
        //ModerationMain(true);
    } else {
        isAllowedTo('view_mlist');
        $context['linktree'][] = array('url' => $scripturl . '?action=groups', 'name' => $txt['groups']);
    }
    // Call the actual function.
    $subActions[$_REQUEST['sa']][0]();
}
示例#2
0
文件: Groups.php 项目: Kheros/MMOver
function Groups()
{
    global $context, $txt, $scripturl, $sourcedir, $user_info;
    // The sub-actions that we can do. Format "Function Name, Mod Bar Index if appropriate".
    $subActions = array('index' => array('GroupList', 'view_groups'), 'members' => array('MembergroupMembers', 'view_groups'), 'requests' => array('GroupRequests', 'group_requests'));
    // Default to sub action 'index' or 'settings' depending on permissions.
    $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'index';
    // Get the template stuff up and running.
    loadLanguage('ManageMembers');
    loadLanguage('ModerationCenter');
    loadTemplate('ManageMembergroups');
    // If we can see the moderation center, and this has a mod bar entry, add the mod center bar.
    if (allowedTo('access_mod_center') || $user_info['mod_cache']['bq'] != '0=1' || $user_info['mod_cache']['gq'] != '0=1' || allowedTo('manage_membergroups')) {
        require_once $sourcedir . '/ModerationCenter.php';
        $_GET['area'] = $_REQUEST['sa'] == 'requests' ? 'groups' : 'viewgroups';
        ModerationMain(true);
    } else {
        isAllowedTo('view_mlist');
        $context['linktree'][] = array('url' => $scripturl . '?action=groups', 'name' => $txt['groups']);
    }
    // Call the actual function.
    $subActions[$_REQUEST['sa']][0]();
}