WordPress.org

Make WordPress Core

Changeset 6499


Ignore:
Timestamp:
12/26/07 19:56:24 (7 years ago)
Author:
ryan
Message:

Limit what getAuthors exposes. Props josephscott for the patch and xknown for the find. fixes #5534 for 2.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/xmlrpc.php

    r6497 r6499  
    472472        } 
    473473 
    474         return(get_users_of_blog()); 
     474        set_current_user(0, $username); 
     475        if(!current_user_can("edit_posts")) { 
     476            return(new IXR_Error(401, __("Sorry, you can not edit posts on this blog."))); 
     477        } 
     478 
     479        do_action('xmlrpc_call', 'wp.getAuthors'); 
     480 
     481        $authors = array(); 
     482        foreach( (array) get_users_of_blog() as $row ) { 
     483            $authors[] = array( 
     484                "user_id"       => $row->user_id, 
     485                "user_login"    => $row->user_login, 
     486                "display_name"  => $row->display_name 
     487            ); 
     488        } 
     489 
     490        return($authors); 
    475491    } 
    476492 
Note: See TracChangeset for help on using the changeset viewer.