Skip to:
Content

BuddyPress.org

Changeset 12920


Ignore:
Timestamp:
04/28/2021 11:50:46 PM (3 years ago)
Author:
dcavins
Message:

Member Invites: Add screens.

Introduce new logic on registration screens
and list-invites and send-invites screens.

See #8139.

Location:
trunk/src/bp-members
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-members/classes/class-bp-members-component.php

    r12917 r12920  
    139139            // Theme compatibility.
    140140            new BP_Registration_Theme_Compat();
     141        }
     142
     143        // Invitations.
     144        if ( is_user_logged_in() && bp_is_user_members_invitations() ) {
     145            if ( bp_is_user_members_invitations_list() ) {
     146                require $this->path . 'bp-members/screens/list-invites.php';
     147            } else {
     148                require $this->path . 'bp-members/screens/send-invites.php';
     149            }
    141150        }
    142151    }
  • trunk/src/bp-members/screens/register.php

    r12875 r12920  
    4343    $bp->signup->step = 'request-details';
    4444
    45     if ( !bp_get_signup_allowed() ) {
     45    // Could the user be accepting an invitation?
     46    $active_invite = false;
     47    if ( bp_get_members_invitations_allowed() ) {
     48        // Check to see if there's a valid invitation.
     49        $maybe_invite = bp_get_members_invitation_from_request();
     50        if ( $maybe_invite->id && $maybe_invite->invitee_email ) {
     51            // Check if this user is already a member.
     52            $args = array(
     53                'invitee_email' => $maybe_invite->invitee_email,
     54                'accepted'      => 'accepted',
     55                'fields'        => 'ids',
     56            );
     57            $accepted_invites = bp_members_invitations_get_invites( $args );
     58            if ( ! $accepted_invites ) {
     59                $active_invite = true;
     60            }
     61        }
     62    }
     63
     64    if ( ! bp_get_signup_allowed() && ! $active_invite ) {
    4665        $bp->signup->step = 'registration-disabled';
    47 
    4866        // If the signup page is submitted, validate and save.
    4967    } elseif ( isset( $_POST['signup_submit'] ) && bp_verify_nonce_request( 'bp_new_signup' ) ) {
Note: See TracChangeset for help on using the changeset viewer.