Changeset 6498

Show
Ignore:
Timestamp:
12/26/07 19:54:35 (6 months ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/xmlrpc.php

    r6496 r6498  
    528528        } 
    529529 
     530        set_current_user(0, $username); 
     531        if(!current_user_can("edit_posts")) { 
     532            return(new IXR_Error(401, __("Sorry, you can not edit posts on this blog."))); 
     533        } 
     534 
    530535        do_action('xmlrpc_call', 'wp.getAuthors'); 
    531536 
    532         return(get_users_of_blog()); 
     537        $authors = array(); 
     538        foreach( (array) get_users_of_blog() as $row ) { 
     539            $authors[] = array( 
     540                "user_id"       => $row->user_id, 
     541                "user_login"    => $row->user_login, 
     542                "display_name"  => $row->display_name 
     543            ); 
     544        } 
     545 
     546        return($authors); 
    533547    } 
    534548