WordPress.org

Making WordPress.org

Ticket #3700: 3700.diff

File 3700.diff, 1.8 KB (added by dryanpress, 4 years ago)
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php
    index a532e93f8..f895d056b 100644
    class Committers { 
    5858                        $response->send();
    5959                }
    6060
     61                if ( ! empty( $committer->allcaps['bbp_blocked'] ) ) {
     62                        $response->add( array(
     63                                'what' => 'committer',
     64                                'data' => new \WP_Error( 'error', sprintf( __( 'The user %s is banned/blocked.', 'wporg-plugins' ), '<code>' . $login . '</code>' ) ),
     65                        ) );
     66                        $response->send();
     67                }
     68
    6169                $result = Tools::grant_plugin_committer( $post->post_name, $committer );
    6270
    6371                if ( ! $result ) {
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php

    diff --git wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php
    index 868036586..7ecbb93d2 100644
    class Plugin_Committers extends Base { 
    107107                        return new WP_Error( 'plugin_user_not_found', __( 'The provided user could not be found.', 'wporg-plugins' ) );
    108108                }
    109109
     110                if ( ! empty( $user->allcaps['bbp_blocked'] ) ) {
     111                        return new WP_Error( 'user_banned_didnt_add', __( 'User is blocked/banned and cannot commmit.', 'wporg-plugins' ) );
     112                }
     113
    110114                $plugin_slug = $request['plugin_slug'];
    111115
    112116                if ( ! Tools::grant_plugin_committer( $plugin_slug, $user ) ) {