Support » Plugin: BP Group Documents » Keeping uploads hidden for non-logged in users/members

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author lenasterg

    (@lenasterg)

    Hi. The ability to view uploaded documents is baseb on the type of each group.
    So for:

    1. public groups, all group data including documents are accessible from everyone (also non logged in users)
    2. privite groups and hidden groups, only members can view groups data and documents
    Thread Starter kallekillen

    (@kallekillen)

    Any way of restricting it for non logged in users even if it’s a public group? I’ve restricted access to the site unless logged in and would like my users to still be able to join groups freely without invite (so using public groups) but would still like to keep any uploads restricted to logged in users only.

    Any advice would be highly appreciated, thanks!

    Plugin Author lenasterg

    (@lenasterg)

    @kallekillen, based on your closed network I updated the code. Please check the 1.9.1 version and also add the following code into your /wp-content/wp-plugins/bp-custom.php file

    /*
     * Download file only in the user is logged in
     */
    
    function bp_only_logged_in_can_download( $error ) {
    // If we have a only logged-in users site
        if ( ! is_user_logged_in() ) {
    	$error = array(
    	    'message' => __( 'You must log in to access the page you requested.', 'buddypress' ),
    	    'redirect' => bp_root_domain()
    	);
        }
        return $error;
        //end added on 16/1/2015
    }
    
    add_filter( 'bp_group_documents_download_access', 'bp_only_logged_in_can_download' );

    Let me know if it works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Keeping uploads hidden for non-logged in users/members’ is closed to new replies.