Changeset 950
- Timestamp:
- 01/28/2009 08:17:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r949 r950 534 534 if ( $is_single_group ) { 535 535 if ( isset($bp['action_variables']) && $bp['action_variables'][0] == 'yes' ) { 536 537 // Check if the user is the group admin first. 538 if ( groups_is_group_admin( $bp['loggedin_userid'], $group_obj->id ) ) { 539 bp_core_add_message( __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' ); 540 bp_core_redirect( bp_group_permalink( $group_obj, false) ); 541 } 542 536 543 // remove the user from the group. 537 544 if ( !groups_leave_group( $group_obj->id ) ) { … … 542 549 bp_core_redirect( $bp['loggedin_domain'] . $bp['groups']['slug'] ); 543 550 } 551 544 552 } else if ( isset($bp['action_variables']) && $bp['action_variables'][0] == 'no' ) { 553 545 554 bp_core_redirect( bp_group_permalink( $group_obj, false) ); 555 546 556 } else { 557 547 558 do_action( 'groups_screen_group_leave', $group_obj->id ); 548 559 549 560 // Show leave group page 550 561 bp_core_load_template( 'groups/leave-group-confirm' ); 562 551 563 } 552 564 } … … 1621 1633 if ( !$user_id ) 1622 1634 $user_id = $bp['loggedin_userid']; 1635 1636 // Admins cannot leave a group, that is until promotion to admin support is implemented. 1637 if ( groups_is_group_admin( $user_id, $group_id ) ) 1638 return false; 1623 1639 1624 1640 // This is exactly the same as deleting and invite, just is_confirmed = 1 NOT 0.
Note: See TracChangeset
for help on using the changeset viewer.