Changeset 2110
- Timestamp:
- 11/24/2009 03:52:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1/bp-groups.php
r2107 r2110 910 910 if ( $bp->is_single_item ) { 911 911 if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) { 912 913 912 // 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 } 917 918 } 918 919 … … 1796 1797 $user_id = $bp->loggedin_user->id; 1797 1798 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 1802 1799 // This is exactly the same as deleting and invite, just is_confirmed = 1 NOT 0. 1803 1800 if ( !groups_uninvite_user( $user_id, $group_id, true ) )
Note: See TracChangeset
for help on using the changeset viewer.