Team join requests

A site can require approval before its members join a team. When it does, the team’s Join button reads Request to join, and pressing it records a request instead of joining. Once a request is open the button reads Request pending. Nothing changes on a site that does not ask for this.

Turning it on

A site plugin returns true from lh_membership_team_join_requires_review( $requires, $user_id, $group_id, $context ) for the joins it wants reviewed. The filter defaults to false, and people who can approve requests (add_users on the site) are never held. $context is join (the Join button).

Deciding

Storage

Requests are rows of the organisation invitation class (LH_Membership_Organisation_Team_Invitation_Manager) with type request: item_id the site, secondary_item_id the team, inviter_id the member. Open until decided, then marked accepted and kept as history. Deleting the account deletes them.

Hooks

Not yet covered

Accepting a captain’s group invite, and requesting membership of a private group, still join or go to the group admins as before.