Ticket #24771: 24771.3.diff
File 24771.3.diff, 1.8 KB (added by , 11 years ago) |
---|
-
wp-includes/user.php
90 90 return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?' ), wp_lostpassword_url() ) ); 91 91 92 92 if ( is_multisite() ) { 93 // Is user marked as spam? 94 if ( 1 == $user->spam ) 93 $spammed = is_user_spammy( $user ); 94 $spammed = apply_filters( 'check_is_user_spammed', $spammed, $user ); 95 if ( is_wp_error( $spammed ) ) 96 return $spammed; 97 elseif ( $spammed ) 95 98 return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) ); 96 97 // Is a user's blog marked as spam?98 if ( !is_super_admin( $user->ID ) && isset( $user->primary_blog ) ) {99 $details = get_blog_details( $user->primary_blog );100 if ( is_object( $details ) && $details->spam == 1 )101 return new WP_Error( 'blog_suspended', __( 'Site Suspended.' ) );102 }103 99 } 104 100 105 101 $user = apply_filters('wp_authenticate_user', $user, $password); -
wp-includes/ms-functions.php
1705 1705 * @since MU 1706 1706 * @uses get_user_by() 1707 1707 * 1708 * @param string $user_login Optional. Defaults to current user.1708 * @param string|WP_User $user_login Optional. Defaults to current user. 1709 1709 * @return bool 1710 1710 */ 1711 1711 function is_user_spammy( $user_login = null ) { 1712 if ( $user_login ) 1712 if ( $user_login instanceof WP_User ) 1713 $user = $user_login; 1714 elseif ( $user_login ) 1713 1715 $user = get_user_by( 'login', $user_login ); 1714 1716 else 1715 1717 $user = wp_get_current_user();