WordPress.org

Make WordPress Core

Changeset 12879


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

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

Location:
trunk/wp-includes
Files:
3 edited

Legend:

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

    r12852 r12879  
    33add_filter ( 'wpmu_validate_user_signup', 'signup_nonce_check' );
    44add_action ( 'init', 'maybe_add_existing_user_to_blog' );
    5 add_filter ( 'wp_authenticate_user', 'wordpressmu_authenticate_siteadmin', 10, 2 );
    65add_action ( 'wpmu_new_user', 'newuser_notify_siteadmin' );
    76add_action ( 'wpmu_activate_user', 'add_new_user_to_blog', 10, 3 );
  • trunk/wp-includes/ms-functions.php

    r12863 r12879  
    17481748}
    17491749
    1750 function wordpressmu_authenticate_siteadmin( $user, $password = '' ) {
    1751     if ( is_super_admin( $user->user_login ) == false && ( $primary_blog = get_usermeta( $user->user_id, "primary_blog" ) ) ) {
    1752         $details = get_blog_details( $primary_blog );
    1753         if ( is_object( $details ) && $details->spam == 1 )
    1754             return new WP_Error('blog_suspended', __('Blog Suspended.'));
    1755     }
    1756     return $user;
    1757 }
    1758 
    17591750function wordpressmu_wp_mail_from( $email ) {
    17601751    if ( strpos( $email, 'wordpress@' ) !== false )
  • 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.