WordPress.org

Plugin Directory

Changeset 606725


Ignore:
Timestamp:
10/01/12 20:42:51 (19 months ago)
Author:
husobj
Message:

Fix authenticate() and get_user_by() issue!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • expire-users/trunk/includes/class-expire-users.php

    r604392 r606725  
    2020     */ 
    2121    function authenticate( $user, $username, $password ) { 
    22         $user = get_user_by( 'login', $username ); 
    23         if ( $user ) { 
    24             $expired = get_user_meta( $user->ID, '_expire_user_expired', true ); 
     22        $checkuser = get_user_by( 'login', $username ); 
     23        if ( $checkuser ) { 
     24            $expired = get_user_meta( $checkuser->ID, '_expire_user_expired', true ); 
    2525            if ( $expired == 'Y' ) { 
    26                 $user = new WP_Error( 'expire_users_expired', __( '<strong>ERROR</strong>: Your user details have expired.', 'expire-users' ) ); 
    2726                remove_action( 'authenticate', 'wp_authenticate_username_password', 20 ); 
     27                return new WP_Error( 'expire_users_expired', __( '<strong>ERROR</strong>: Your user details have expired.', 'expire-users' ) ); 
    2828            } 
    2929        } 
Note: See TracChangeset for help on using the changeset viewer.