WordPress.org

Plugin Directory

Changeset 550751


Ignore:
Timestamp:
05/30/12 06:56:17 (23 months ago)
Author:
picklewagon
Message:

fix bug showing error message permanently on login page

Location:
new-user-approve/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • new-user-approve/trunk/new-user-approve.php

    r550729 r550751  
    6666        add_filter('login_message', array( $this, 'welcome_user')); 
    6767        add_filter('screen_layout_columns', array( $this, 'screen_layout_columns'), 10, 2); 
    68         add_filter( 'authenticate', array( $this, 'validate_user' ), 30, 3); 
     68        add_filter( 'wp_authenticate_user', array( $this, 'authenticate_user' ), 10, 2); 
    6969    } 
    7070 
     
    428428    } 
    429429 
    430     public function validate_user( $empty, $username, $password ) { 
    431         if ( empty( $password ) ) { 
    432             return; 
    433         } 
    434  
    435         if ( empty( $username ) ) { 
    436             return; 
    437         } 
    438  
    439         $user = get_user_by( 'login', $username ); 
    440  
    441         $result = wp_check_password( $password, $user->user_pass, $user->ID ); 
    442         if ( !$result ) { 
    443             return; 
    444         } 
    445  
    446         $status = get_user_meta( $user->ID, 'pw_user_status', true ); 
     430    public function authenticate_user( $userdata, $password ) { 
     431        $status = get_user_meta( $userdata->ID, 'pw_user_status', true ); 
    447432 
    448433        if ( empty( $status ) ) { 
    449434            // the user does not have a status so let's assume the user is good to go 
    450             return $user; 
     435            return $userdata; 
    451436        } 
    452437 
     
    460445                break; 
    461446            case 'approved': 
    462                 $message = $user; 
     447                $message = $userdata; 
    463448                break; 
    464449        } 
  • new-user-approve/trunk/readme.txt

    r550728 r550751  
    33Donate link: http://picklewagon.com/wordpress/new-user-approve/donate 
    44Tags: users, registration 
    5 Requires at least: 3.2 
     5Requires at least: 3.2.1 
    66Tested up to: 3.3.2 
    77Stable tag: 1.3.2 
     
    5252 
    5353== Changelog == 
     54 
     55= 1.3.3 = 
     56* fix bug showing error message permanently on login page 
    5457 
    5558= 1.3.2 = 
Note: See TracChangeset for help on using the changeset viewer.