WordPress.org

Make WordPress Core


Ignore:
Timestamp:
01/13/2006 07:19:09 PM (16 years ago)
Author:
ryan
Message:

Make the xmlrpc user the current user. fixes #2273

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable-functions.php

    r3343 r3430  
    33    /* These functions can be replaced via plugins.  They are loaded after
    44     plugins are loaded. */
     5
     6if ( !function_exists('set_current_user') ) :
     7function set_current_user($id, $name = '') {
     8    global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $current_user;
     9
     10    $current_user   = '';
     11
     12    $current_user   = new WP_User($id, $name);
     13
     14    $userdata   = get_userdatabylogin($user_login);
     15
     16    $user_login = $userdata->user_login;
     17    $user_level = $userdata->user_level;
     18    $user_ID    = $userdata->ID;
     19    $user_email = $userdata->user_email;
     20    $user_url   = $userdata->user_url;
     21    $user_pass_md5  = md5($userdata->user_pass);
     22    $user_identity  = $userdata->display_name;
     23
     24    do_action('set_current_user');
     25
     26    return $current_user;
     27}
     28endif;
    529
    630
     
    832function get_currentuserinfo() {
    933    global $user_login, $userdata, $user_level, $user_ID, $user_email, $user_url, $user_pass_md5, $user_identity, $current_user;
     34
     35    if ( defined('XMLRPC_REQUEST') && XMLRPC_REQUEST )
     36        return false;
    1037
    1138    if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ||
Note: See TracChangeset for help on using the changeset viewer.