WordPress.org

Make WordPress Core

Ticket #5579: 5579-Remove-user_pass_ok.diff

File 5579-Remove-user_pass_ok.diff, 1.3 KB (added by brianlayman, 13 years ago)

Move user_pass_ok from user.php to xmlrpc.php

  • wp-includes/user.php

     
    1313        return $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$userid' AND post_type = 'post' AND " . get_private_posts_cap_sql('post'));
    1414}
    1515
    16 // TODO: xmlrpc only.  Maybe move to xmlrpc.php.
    17 function user_pass_ok($user_login,$user_pass) {
    18         $userdata = get_userdatabylogin($user_login);
    19         return wp_check_password($user_pass, $userdata->user_pass);
    20 }
    21 
    2216//
    2317// User option functions
    2418//
  • xmlrpc.php

     
    1717
    1818include('./wp-config.php');
    1919
     20if ( !function_exists('user_pass_ok') ) :
     21function user_pass_ok($user_login,$user_pass) {
     22        global $cache_userdata;
     23        if ( empty($cache_userdata[$user_login]) ) {
     24                $userdata = get_userdatabylogin($user_login);
     25        } else {
     26                $userdata = $cache_userdata[$user_login];
     27        }
     28        return (md5($user_pass) == $userdata->user_pass);
     29}
     30endif;
     31
    2032if ( isset( $_GET['rsd'] ) ) { // http://archipelago.phrasewise.com/rsd
    2133header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
    2234?>