function scoper_use_posted_init_options()
{
    if (0 !== strpos($GLOBALS['plugin_page_cr'], 'rs-') || defined('GROUP_ROLES_RS')) {
        return;
    }
    if (isset($_POST['rs_defaults'])) {
        $arr = scoper_default_options();
    } else {
        $arr = $_POST;
    }
    define('SCOPER_CUSTOM_USER_BLOGCAPS', !empty($arr['custom_user_blogcaps']));
    define('DEFINE_GROUPS_RS', !empty($arr['define_usergroups']));
    define('GROUP_ROLES_RS', !empty($arr['define_usergroups']) && !empty($arr['enable_group_roles']));
    define('USER_ROLES_RS', !empty($arr['enable_user_roles']));
    wpp_cache_init(IS_MU_RS && scoper_establish_group_scope());
}
Пример #2
0
function scoper_get_init_options()
{
    define('SCOPER_CUSTOM_USER_BLOGCAPS', scoper_get_option('custom_user_blogcaps'));
    // TODO: eliminate this?
    $define_groups = scoper_get_option('define_usergroups');
    define('DEFINE_GROUPS_RS', $define_groups);
    define('GROUP_ROLES_RS', $define_groups && scoper_get_option('enable_group_roles'));
    define('USER_ROLES_RS', scoper_get_option('enable_user_roles'));
    if (!defined('DISABLE_PERSISTENT_CACHE') && !scoper_get_option('persistent_cache')) {
        define('DISABLE_PERSISTENT_CACHE', true);
    }
    wpp_cache_init(IS_MU_RS && scoper_establish_group_scope());
}