Changeset 2114 for trunk/bp-groups.php
- Timestamp:
- 11/24/2009 10:05:01 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups.php
r2088 r2114 821 821 822 822 if ( $bp->is_single_item ) { 823 if ( 'post' == $wire_action && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id) ) {823 if ( 'post' == $wire_action && ( is_site_admin() || groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) ) { 824 824 /* Check the nonce first. */ 825 825 if ( !check_admin_referer( 'bp_wire_post' ) ) … … 836 836 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) . '/' . $bp->wire->slug ); 837 837 838 } else if ( 'delete' == $wire_action && groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id) ) {838 } else if ( 'delete' == $wire_action && ( is_site_admin() || groups_is_user_member( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) ) { 839 839 $wire_message_id = $bp->action_variables[1]; 840 840 … … 912 912 if ( $bp->is_single_item ) { 913 913 if ( isset($bp->action_variables) && 'yes' == $bp->action_variables[0] ) { 914 915 914 // Check if the user is the group admin first. 916 if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { 917 bp_core_add_message( __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' ); 918 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 915 if ( count( groups_get_group_admins( $bp->groups->current_group->id ) ) < 2 ) { 916 if ( groups_is_user_admin( $bp->loggedin_user->id, $bp->groups->current_group->id ) ) { 917 bp_core_add_message( __('As the only group administrator, you cannot leave this group.', 'buddypress'), 'error' ); 918 bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) ); 919 } 919 920 } 920 921 … … 1810 1811 $user_id = $bp->loggedin_user->id; 1811 1812 1812 // Admins cannot leave a group, that is until promotion to admin support is implemented.1813 if ( groups_is_user_admin( $user_id, $group_id ) )1814 return false;1815 1816 1813 // This is exactly the same as deleting and invite, just is_confirmed = 1 NOT 0. 1817 1814 if ( !groups_uninvite_user( $user_id, $group_id, true ) ) … … 1834 1831 if ( groups_check_user_has_invite( $user_id, $group_id ) ) 1835 1832 groups_delete_invite( $user_id, $group_id ); 1833 1834 if ( !$bp->groups->current_group ) 1835 $bp->groups->current_group = new BP_Groups_Group( $group_id, false, false ); 1836 1836 1837 1837 $new_member = new BP_Groups_Member; … … 1852 1852 'primary_link' => apply_filters( 'groups_activity_joined_group_primary_link', bp_get_group_permalink( $bp->groups->current_group ) ), 1853 1853 'component_action' => 'joined_group', 1854 'item_id' => $ bp->groups->current_group->id1854 'item_id' => $group_id 1855 1855 ) ); 1856 1856
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)