Skip Navigation

[Résolu] Make BuddyPress Private

This support ticket is created Il y a 8 années et 3 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

Marqué : 

This topic contains 12 réponses, has 3 voix.

Last updated by Adriano Il y a 8 années et 2 mois.

Assisted by: Adriano.

Auteur
Publications
#359050

I am trying to: Make buddy press private

I visited this URL: hidden link

I expected to see: my access error page

Instead, I got: access to the members page

#359051

I went to access and created a custom group for buddy press it let me choose Groups, Members and Activity to bock but it still gives access.

#359149

Buddy Press presents a PHP Notice on activation, which I am not sure if they (BuddyPress Team) are aware of.

You can enable WP Debug to see it, and if you would like to contribute, report it to the BuddyPress Support Forums.
https://codex.wordpress.org/WP_DEBUG

The Problem you describe is reproducible locally, if you control the /members page with Access, it will not affect the front end.
Access works just fine on "normal" pages, but not on the ones created by BuddyPress.

I assume this is because BuddyPress bypasses a required hook for Access to control the output, but I need to consult this with the DEV team first.

I will get back at you very soon.

Thank you for your patience

#359366

Here is the debug info. I will also give it to the buddypress team

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/sdleaders619/public_html/wp-includes/functions.php on line 3792

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

Notice: Undefined variable: html in /home/sdleaders619/public_html/wp-content/themes/ultimatum/wonderfoundry/functions/print-head.php on line 87

#359400

Hello,

Do you have any update on this?

#359828

This always happens with your support. You answer and say "I will get back at you very soon." and then nothing for days. It also seems like everything I want this toolset to do it can't do, which is beyond disappointing.

#359913

Hello Oliver.

I honestly apologize this delay here.
At the moment I escalated this Thread I saw, the 2nd Tier is handling a similar issue and also contacted our Access DEV in regard, that is why I supposed I will get a feedback very soon.

By now the issue is still under investigation and I will avoid to make false promises, as this is a compatibility issue and not a Access Bug, I can not state a ETA for a fix.

I seriously am sorry for this, there is not much I can do by now unless to wait for news from the 2nd tier and DEV Team.

I have pushed the escalated thread again to bring it on top of the queue as fast as possible.

To solve the issue temporarily you may consider use a Plugin or Custom Code:
hidden link
hidden link

I apologize the delay.

As per the error messages you posted above, only the

Notice: bp_setup_current_user was called incorrectly. The current user is being initialized without using $wp->init(). Please see Debugging in WordPress for more information. (This message was added in version 1.7.) in /home/sdleaders619/public_html/wp-includes/functions.php on line 3792

is relevant to BuddyPress.

The

Notice: The called constructor method for WP_Widget is deprecated since version 4.3.0! Use
__construct()
instead. in /home/sdleaders619/public_html/wp-includes/functions.php on line 3624

must be by another Plugin you use on the site, as I did not get that with BuddyPress and Toolset only.

Thank you for your patience and also for you reminding me to keep this Thread at high level importance.

#360160

Hello,

I’m Adriano, Toolset support lead and I have been escalated to this thread. I’ll give my best to help you to achieve your needs through Toolset components.

BuddyPress has its own template mechanism but fortunately it provides some filters that let us do something just before the template rendering. I'll talk with our Access developer to see what we can do here. I'll keep you posted.

#361127

I used this plugin to get it done. https://wordpress.org/plugins/bp-registration-options/. Could not wait any longer. Thank You and please keep me informed.

#362151

Hello?

#363487

I pushed for news from the DEV Team.

Please acknowledge that this is a Compatibility issue and might require some time and co-wrok with the 3rd party Software Developer.

We try to solve compatibility issues as fast and reliable we can, but I can not state any ETA or solution to this problem by now.

I apologize any delays and inconveniences

Thank you for your patience and collaboration.

#365916

I apologize the delay here.

Please add to your theme/functions.php this code:
(Backup the Database and FTP previously)

add_action('bp_members_screen_index','otg_access_set_bp_permissions');
function otg_access_set_bp_permissions(){
    global $wp_query, $post;

    if ( isset($wp_query->queried_object->ID ) ){
        $post_id = $wp_query->queried_object->ID;
    }else{
        return;
    }
    $user_can_read_pages = otg_access_post_type_permissions_api( $post_id );
    if ( !$user_can_read_pages ){
        $wp_query->set_404();
        status_header(404);
        include( get_query_template( '404' ) );
        die();
    }
}

function otg_access_post_type_permissions_api( $post_id = '' ){
    global $wpcf_access, $user_level;

    if ( empty($post_id) || empty($wpcf_access) ){
        return;
    }

    $post = get_post($post_id);
    $post_type = $post->post_type;

    $post_group = get_post_meta( $post_id, '_wpcf_access_group', true);
    $user_role = Access_Helper::wpcf_get_current_logged_user_role();
    $current_user_can = false;
    if ( !empty($post_group) ){
        if ( isset($wpcf_access->settings->types[$post_group]['permissions']['read']['role']) ){
            if ( $wpcf_access->settings->types[$post_group]['permissions']['read']['role'] != 'guest' ){
                if ( $user_role != 'guest' ){
                    $current_user_can = Access_Helper::wpcf_access_check_if_user_can($wpcf_access->settings->types[$post_group]['permissions']['read']['role'], $user_level);
                }else{
                    $current_user_can = false;
                }
            }else{
                    $current_user_can = true;
            }
            return $current_user_can;

        }
    }

    if ( $wpcf_access->settings->types[$post_type]['permissions']['read']['role'] != 'guest' ){
        if ( $user_role != 'guest' ){
            $current_user_can = Access_Helper::wpcf_access_check_if_user_can($wpcf_access->settings->types[$post_type]['permissions']['read']['role'], $user_level);
        }else{
            $current_user_can = false;
        }
    }else{
            $current_user_can = true;
    }
    return $current_user_can;
}

That's a temporary fix, until we provide a Access version with a official fix.
It's a work around for the members page, also can be used for other bp pages.

Please let me know if the above solution works for you, I look forward to your reply!

Thank you for your patience.

#367531

Shall we mark this as resolved?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.