The MU forums have moved to WordPress.org

XMLRPC user "can not add pages" (4 posts)

  1. cogmios
    Member
    Posted 14 years ago #

    The XMLRPC returns me:

    Array ( [faultCode] => 401 [faultString] => Sorry, you cannot add new pages. )

    for a user I created and who is admin for his blog.
    I have the correct blog ID and I login as this user.
    I use the XMLRPC.php url from the root so http://x.com/xmlrpc.php

    I do not understand this message since the user is administrator on his own blog.

  2. cogmios
    Member
    Posted 14 years ago #

    So this is from the check:

    if ( !current_user_can("publish_pages") )
    			return(new IXR_Error(401, __("Sorry, you cannot add new pages.")));

    I dont understand why the user has no rights to publish pages, he is administrator on his own blog?

  3. cogmios
    Member
    Posted 14 years ago #

    I did a check with WLW and with this one I can create pages for this user. I dont really see the difference my call looks like this:

    <?xml version="1.0" encoding="utf-8"?>
    <methodCall>
    <methodName><![CDATA[wp.newPage]]></methodName>
    <params>
    <param>
    <value>
    <string><![CDATA[8]]></string>
    </value>
    </param>
    <param>
    <value>
    <string><![CDATA[username]]></string>
    </value>
    </param>
    <param>
    <value>
    <string><![CDATA[password]]></string>
    
    </value>
    </param>
    <param>
    <value>
    <struct>
    <member>
    <name><![CDATA[title]]></name>
    <value>
    <string><![CDATA[pagename]]></string>
    </value>
    </member>
    <member>
    <name><![CDATA[description]]></name>
    <value>
    <string><![CDATA[<?php $objectname = "a"; include_once "bla.php"; ?>]]></string>
    </value>
    </member>
    
    <member>
    <name><![CDATA[permaLink]]></name>
    <value>
    <string><![CDATA[somename]]></string>
    </value>
    </member>
    <member>
    <name><![CDATA[wp_page_parent_id]]></name>
    <value>
    <int><![CDATA[5]]></int>
    </value>
    </member>
    </struct>
    </value>
    </param>
    <param>
    <value>
    
    <string><![CDATA[1]]></string>
    </value>
    </param>
    </params>
    </methodCall>
  4. cogmios
    Member
    Posted 14 years ago #

    I got it , I do not take the Blog ID as in "overall blog id" but the blod id # of the particular user, in this case 1...

    SOLVED.

About this Topic