Changeset 21413 for trunk/wp-includes/user.php
- Timestamp:
- 08/03/2012 01:06:05 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/user.php
r21374 r21413 85 85 } 86 86 87 $user data= get_user_by('login', $username);88 89 if ( !$user data)87 $user = get_user_by('login', $username); 88 89 if ( !$user ) 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 93 // Is user marked as spam? 94 if ( 1 == $user data->spam)94 if ( 1 == $user->spam) 95 95 return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.')); 96 96 97 97 // Is a user's blog marked as spam? 98 if ( !is_super_admin( $user data->ID ) && isset($userdata->primary_blog) ) {99 $details = get_blog_details( $user data->primary_blog );98 if ( !is_super_admin( $user->ID ) && isset($user->primary_blog) ) { 99 $details = get_blog_details( $user->primary_blog ); 100 100 if ( is_object( $details ) && $details->spam == 1 ) 101 101 return new WP_Error('blog_suspended', __('Site Suspended.')); … … 103 103 } 104 104 105 $user data = apply_filters('wp_authenticate_user', $userdata, $password);106 if ( is_wp_error($user data) )107 return $user data;108 109 if ( !wp_check_password($password, $user data->user_pass, $userdata->ID) )105 $user = apply_filters('wp_authenticate_user', $user, $password); 106 if ( is_wp_error($user) ) 107 return $user; 108 109 if ( !wp_check_password($password, $user->user_pass, $user->ID) ) 110 110 return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ), 111 111 $username, wp_lostpassword_url() ) ); 112 112 113 $user = new WP_User($userdata->ID);114 113 return $user; 115 114 } … … 256 255 257 256 if ( empty( $user ) ) 258 $user = wp_get_current_user(); 259 else 260 $user = new WP_User( $user ); 261 262 if ( ! $user->exists() ) 257 $user = get_current_user_id(); 258 259 if ( ! $user = get_userdata( $user ) ) 263 260 return false; 264 261 … … 929 926 930 927 if ( '' == $for_user_id ) 931 $user = wp_get_current_user(); 932 else 933 $user = new WP_User($for_user_id); 934 935 $userdata = null; 936 $user_ID = (int) $user->ID; 937 $user_level = (int) isset($user->user_level) ? $user->user_level : 0; 938 939 if ( ! $user->exists() ) { 928 $for_user_id = get_current_user_id(); 929 $user = get_userdata( $for_user_id ); 930 931 if ( ! $user ) { 932 $user_ID = 0; 933 $user_level = 0; 934 $userdata = null; 940 935 $user_login = $user_email = $user_url = $user_identity = ''; 941 936 return; 942 937 } 943 938 939 $user_ID = (int) $user->ID; 940 $user_level = (int) $user->user_level; 944 941 $userdata = $user; 945 942 $user_login = $user->user_login;
Note: See TracChangeset
for help on using the changeset viewer.