Making WordPress.org

Changeset 7415


Ignore:
Timestamp:
07/10/2018 10:58:38 PM (8 years ago)
Author:
obenland
Message:

Plugins: Prevent BANNED users from getting plugin commit

Props dryanpress.
Fixes #3700.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/metabox/class-committers.php

    r6287 r7415  
    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
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-committers.php

    r6287 r7415  
    108108                }
    109109
     110                if ( ! empty( $user->allcaps['bbp_blocked'] ) ) {
     111                        return new WP_Error( 'plugin_user_banned', __( 'User is blocked/banned and cannot be granted commmit.', 'wporg-plugins' ) );
     112                }
     113
    110114                $plugin_slug = $request['plugin_slug'];
    111115
Note: See TracChangeset for help on using the changeset viewer.