Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/16/2011 08:08:45 PM (15 years ago)
Author:
boonebgorges
Message:

Adds toggle for who can send group invitations, in order to make the option more consistent and configurable throughout BP. Fixes #2005. Props DJPaul for help cleaning up the patches.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-screens.php

    r4506 r4524  
    506506                if ( isset( $_POST['save'] ) ) {
    507507                        $enable_forum   = ( isset($_POST['group-show-forum'] ) ) ? 1 : 0;
     508                       
     509                        // Checked against a whitelist for security
    508510                        $allowed_status = apply_filters( 'groups_allowed_status', array( 'public', 'private', 'hidden' ) );
    509511                        $status         = ( in_array( $_POST['group-status'], (array)$allowed_status ) ) ? $_POST['group-status'] : 'public';
     512                       
     513                        // Checked against a whitelist for security
     514                        $allowed_invite_status = apply_filters( 'groups_allowed_invite_status', array( 'members', 'mods', 'admins' ) );
     515                        $invite_status         = in_array( $_POST['group-invite-status'], (array)$allowed_invite_status ) ? $_POST['group-invite-status'] : 'members';
    510516
    511517                        // Check the nonce
     
    513519                                return false;
    514520
    515                         if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status ) ) {
     521                        if ( !groups_edit_group_settings( $_POST['group-id'], $enable_forum, $status, $invite_status ) ) {
    516522                                bp_core_add_message( __( 'There was an error updating group settings, please try again.', 'buddypress' ), 'error' );
    517523                        } else {
Note: See TracChangeset for help on using the changeset viewer.