Changeset 13862
- Timestamp:
- 05/11/2024 10:19:04 AM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/groups/ajax.php
r13504 r13862 4 4 * 5 5 * @since 3.0.0 6 * @version 1 2.0.06 * @version 14.0.0 7 7 */ 8 8 … … 75 75 // Cast gid as integer. 76 76 $group_id = (int) $_POST['item_id']; 77 $user_id = bp_loggedin_user_id(); 78 79 if ( bp_is_user_groups() && bp_current_user_can_moderate() ) { 80 $user_id = bp_displayed_user_id(); 81 } 77 82 78 83 $errors = array( … … 81 86 ); 82 87 83 if ( groups_is_user_banned( bp_loggedin_user_id(), $group_id ) ) {88 if ( groups_is_user_banned( $user_id, $group_id ) ) { 84 89 $response['feedback'] = $errors['cannot']; 85 90 … … 98 103 99 104 case 'groups_accept_invite': 100 if ( ! groups_check_user_has_invite( bp_displayed_user_id(), $group_id ) ) {105 if ( ! groups_check_user_has_invite( $user_id, $group_id ) ) { 101 106 wp_send_json_error( $response ); 102 107 } 103 108 104 if ( ! groups_accept_invite( bp_displayed_user_id(), $group_id ) ) {109 if ( ! groups_accept_invite( $user_id, $group_id ) ) { 105 110 $response = array( 106 111 'feedback' => sprintf( … … 138 143 139 144 case 'groups_reject_invite': 140 if ( ! groups_reject_invite( bp_displayed_user_id(), $group_id ) ) {145 if ( ! groups_reject_invite( $user_id, $group_id ) ) { 141 146 $response = array( 142 147 'feedback' => sprintf( … … 159 164 160 165 case 'groups_join_group': 161 if ( groups_is_user_member( bp_loggedin_user_id(), $group->id ) ) {166 if ( groups_is_user_member( $user_id, $group->id ) ) { 162 167 $response = array( 163 168 'feedback' => $errors['member'], … … 190 195 191 196 case 'groups_request_membership' : 192 if ( ! groups_send_membership_request( [ 'user_id' => bp_loggedin_user_id(), 'group_id' => $group->id ] ) ) {197 if ( ! groups_send_membership_request( [ 'user_id' => $user_id, 'group_id' => $group->id ] ) ) { 193 198 $response = array( 194 199 'feedback' => sprintf(
Note: See TracChangeset
for help on using the changeset viewer.