Make WordPress Core


Ignore:
Timestamp:
01/27/2010 06:11:17 PM (14 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r12853 r12879  
    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')));
    9090
    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.'));
     91    if ( is_multisite() ) {
     92        // Is user marked as spam?
     93        if ( 1 == $userdata->spam)
     94            return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
     95
     96        // Is a user's blog marked as spam?
     97        if ( !is_super_admin( $userdata->ID ) && isset($userdata->primary_blog) ) {
     98            $details = get_blog_details( $userdata->primary_blog );
     99            if ( is_object( $details ) && $details->spam == 1 )
     100                return new WP_Error('blog_suspended', __('Blog Suspended.'));
     101        }
     102    }
    93103
    94104    $userdata = apply_filters('wp_authenticate_user', $userdata, $password);
Note: See TracChangeset for help on using the changeset viewer.