Skip to:
Content

BuddyPress.org

Changeset 2110


Ignore:
Timestamp:
11/24/2009 03:52:00 PM (15 years ago)
Author:
apeatling
Message:

Fixes #1351

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bp-groups.php

    r2107 r2110  
    910910    if ( $bp->is_single_item ) {
    911911        if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) {
    912 
    913912            // Check if the user is the group admin first.
    914             if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
    915                 bp_core_add_message(  __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' );
    916                 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
     913            if ( count( groups_get_group_admins( $bp->groups->current_group->id ) ) < 2 ) {
     914                if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) {
     915                    bp_core_add_message(  __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' );
     916                    bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
     917                }
    917918            }
    918919
     
    17961797        $user_id = $bp->loggedin_user->id;
    17971798
    1798     // Admins cannot leave a group, that is until promotion to admin support is implemented.
    1799     if ( groups_is_user_admin( $user_id, $group_id ) )
    1800         return false;
    1801 
    18021799    // This is exactly the same as deleting and invite, just is_confirmed = 1 NOT 0.
    18031800    if ( !groups_uninvite_user( $user_id, $group_id, true ) )
Note: See TracChangeset for help on using the changeset viewer.