Skip to:
Content
Pages
Categories
Search
Top
Bottom

Challenge: Removing Group Members by Email Domain (Roles permissions ignored)


  • chrisleighh
    Participant

    @chrisleighh

    I have a membership site that has several private groups for paying members. Their access is restricted by their membership role. So for example, only people with the “approved” role can access “Group 1”.
    The challenge is that if the customer no longer pays for membership and we change their role to “not approved” they still have access to, and receive email updates, from that group because their group access ignores the roles if they are already a member.

    So I need a way to easily scan the email addresses (our paying members are by company so the email domain is the easiest way to ID and verify who should be in the group) when looking at group members.

    Is there a way to do this? Or is there an update that I can make so that group Admins can see the user email address next to their name when viewing the member list? I’d only want the group admin to see this, of course.

Viewing 5 replies - 1 through 5 (of 5 total)

  • Venutius
    Moderator

    @venutius

    This code will display the email addresses in the group members list:

    <?php
    $group_id = bp_get_current_group_id();
    $user_id = get_current_user_id();
    if ( groups_is_user_admin( $user_id, $group_id ) || groups_is_user_mod( $user_id, $group_id ) || current_user_can( 'manage_options' ) ) :
        $user_data = get_userdata( bp_get_group_member_id() ); ?>
        <div class="user_email">
    	<label><?php echo $user_data->user_email; ?></label>
        </div>
        <?php
    endif;

    You’d need to overload the members.php for your BP theme and place this code in there.

    To automatically remove their membership you could write a script to hook on the member role change and automatically remove them from the group but that’s a more complex job, you’d probably need to pay someone to write it specifically for your site.


    chrisleighh
    Participant

    @chrisleighh

    Does this get it to show up on the admin side? Here?

    wp-admin/admin.php?page=bp-groups&gid=9&action=edit

    Or is that on the front? I”d LOVE to be able to see the email address on the admin side if at all possible.


    chrisleighh
    Participant

    @chrisleighh

    BTW – I’m certainly willing to pay for that work to be done.
    Any idea where to advertise for that? It’s very important for us.


    Venutius
    Moderator

    @venutius

    This displays the email to group admin in the group members list at the front end.


    Venutius
    Moderator

    @venutius

    I could probably write you a plugin to do that email me on venutius at buddyuser.com and we can talk about it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar