Changeset 10940
- Timestamp:
- 04/30/2021 08:11:45 AM (5 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin
- Files:
-
- 2 edited
-
class-user-registrations-list-table.php (modified) (1 diff)
-
ui.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/class-user-registrations-list-table.php
r10928 r10940 244 244 245 245 } else { 246 $url = add_query_arg( 247 'email', 248 urlencode( $item->user_email ), 246 // Account created, find the user. 247 $user = get_user_by( 'login', $item->user_login ); 248 249 $url = add_query_arg( 250 'user_id', 251 urlencode( $user->ID ), 249 252 admin_url( 'admin-post.php?action=login_block_account' ) 250 253 ); 251 $url = wp_nonce_url( $url, 'block_account_' . $item->user_email ); 252 253 if ( 254 ! ( $user = get_user_by( 'login', $item->user_login ) ) || 255 'BLOCKED' !== substr( $user->user_pass, 0, 7 ) 256 ) { 254 $url = wp_nonce_url( $url, 'block_account_' . $user->ID ); 255 256 if ( $user && 'BLOCKED' !== substr( $user->user_pass, 0, 7 ) ) { 257 257 $row_actions['block-account'] = '<a href="' . esc_url( $url ) . '">Block Account</a>'; 258 258 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/ui.php
r10933 r10940 204 204 } 205 205 206 $email = $_REQUEST['email'] ?? ''; 207 208 check_admin_referer( 'block_account_' . $email ); 209 210 $user = get_user_by( 'email', $email ); 211 if ( $user && defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 206 if ( empty( $_REQUEST['user_id'] ) ) { 207 die(); 208 } 209 210 $user_id = (int) $_REQUEST['user_id']; 211 212 check_admin_referer( 'block_account_' . $user_id ); 213 214 if ( $user_id && defined( 'WPORG_SUPPORT_FORUMS_BLOGID' ) ) { 215 216 // Switch first so that bbPress loads with the correct context. 217 // This also ensures that the bbp_participant code doesn't kick in. 218 switch_to_blog( WPORG_SUPPORT_FORUMS_BLOGID ); 219 212 220 // Load the support forums.. 213 221 include_once WP_PLUGIN_DIR . '/bbpress/bbpress.php'; 214 222 include_once WP_PLUGIN_DIR . '/support-forums/support-forums.php'; 215 223 216 // Then switch to it (Must be done after bbPress is loaded to get roles)217 switch_to_blog( WPORG_SUPPORT_FORUMS_BLOGID );218 219 224 // Set the user to blocked. Support forum hooks will take care of the rest. 220 bbp_set_user_role( $user ->ID, bbp_get_blocked_role() );225 bbp_set_user_role( $user_id, bbp_get_blocked_role() ); 221 226 222 227 restore_current_blog();
Note: See TracChangeset
for help on using the changeset viewer.