Make WordPress Core

Changeset 12853


Ignore:
Timestamp:
01/26/2010 08:25:34 PM (15 years ago)
Author:
ryan
Message:

Integrate login_spam_check() into wp_authenticate_username_password(). see #11644

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r12852 r12853  
    18881888}
    18891889
    1890 function login_spam_check( $user, $password ) {
    1891     if ( is_user_spammy( $user->ID ) )
    1892         return new WP_Error('invalid_username', __('<strong>ERROR</strong>: your account has been marked as a spammer.'));
    1893     return $user;
    1894 }
    1895 add_action( 'wp_authenticate_user', 'login_spam_check', 10, 2 );
    1896 
    18971890function update_blog_public( $old_value, $value ) {
    18981891    global $wpdb;
  • trunk/wp-includes/user.php

    r12766 r12853  
    8484    }
    8585
    86     $userdata = get_userdatabylogin($username);
    87 
    88     if ( !$userdata ) {
     86    $userdata = get_user_by('login', $username);
     87
     88    if ( !$userdata )
    8989        return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));
    90     }
     90
     91    if ( is_multisite() && (1 == $userdata->spam) )
     92        return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
    9193
    9294    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
    93     if ( is_wp_error($userdata) ) {
     95    if ( is_wp_error($userdata) )
    9496        return $userdata;
    95     }
    96 
    97     if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) ) {
     97
     98    if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) )
    9899        return new WP_Error('incorrect_password', sprintf(__('<strong>ERROR</strong>: Incorrect password. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));
    99     }
    100100
    101101    $user =  new WP_User($userdata->ID);
Note: See TracChangeset for help on using the changeset viewer.