Page 4 of 8 FirstFirst ... 23456 ... LastLast
Results 46 to 60 of 108

Thread: XML API PHP Class version 1.0

  1. #46
    Member lexand's Avatar
    Join Date
    Mar 2010
    Location
    Ukraine
    Posts
    7

    Default xmlapi and fileop

    HI

    i'd created separate post for the my problem, But I see that discussion about xmlapi is in this thread

    Here
    http://forums.cpanel.net/f42/xmlapi-...tml#post647589
    is my original post
    The sun will shine for you, while you will shine for Sun.

  2. #47
    Member
    Join Date
    Apr 2010
    Posts
    14

    Default

    Hi, can someone post a valid link to download the API class?

    Thanks,
    Darren

  3. #48
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Feb 2003
    Location
    Gothenburg, Sweden
    Posts
    329
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    Hi Darren,

    You can find the downloads here by version:
    Index of /lib/xmlapi/php

    Cheers

    twitter: oderland_david

  4. #49
    Member
    Join Date
    Apr 2010
    Posts
    14

    Default

    Hi, I have decided to use cURL with the API because the PHP script is very insecure in wanting to pass the root password in clear text. I used a remote access key instead over SSL.

  5. #50
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Feb 2003
    Location
    Gothenburg, Sweden
    Posts
    329
    cPanel/WHM Access Level

    DataCenter Provider

    Default

    You might want to re-read the xml-api class docs.

    I'm using the xml-api class with ssl and root user and a provided hash.

    twitter: oderland_david

  6. #51
    Member MattDees's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    In the class tarball see:

    xmlapi_php/hashauth_example.php
    Matt Dees

  7. #52
    Member
    Join Date
    Nov 2009
    Posts
    13

    Default

    Question: hope so every one knows Rvsitebuilder when you setup that it ask which DB you want to create and what will be DB username and Password and finaly when you provide and press button it automaticaly create DB, DB user, password and also authenticate user over DB my question is how all over cpanel forum an api ask hask key, root username and password for doing any action related to whm than why and how rvsitebuilder not ask and it do all quick quick? I am also willing to build a plugin which i install inside my WHM and using it i can run any command or action which WHM does but main thing i don't want to put or provide WHM root password or remote access key. Is it possible ???

  8. #53
    Registered User
    Join Date
    May 2010
    Posts
    1

    Default

    Hi,
    I try to use this class on my HostGator server but it doesn't work. Maybe someone who has an reseller account can say how to configure this connection.
    I've done that:
    PHP Code:
    include_once 'xmlapi.php';

    $user ""// the main account username
    $ip "";  // the account IP address
    $hash ''// hash provided in whm

    $xmlapi = new xmlapi($ip);
    $xmlapi->hash_auth($user,$hash);
    $xmlapi->set_http_client('fopen');

    $xmlapi->set_debug(1);
    print 
    $xmlapi->api2_query($user"Email""listpopswithdisk"); 
    Nothing happens.

    When fopen is activated, I get this warning :
    Code:
    ...failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in...

  9. #54

    Default

    1) Do you have (normal) access to WHM?

    2) Did you enter the following correctly?

    Code:
    $user = ""; // the main account username 
    $ip = "";  // the account IP address 
    $hash = ''; // hash provided in whm
    user = your WHM user_id
    ip= IP-address to access WHM
    hash = the complete hash which is found in your remote access settings

  10. #55
    Registered User
    Join Date
    Jul 2008
    Posts
    4

    Default

    Hi,

    This is probably not related to the API; but then again - it might be...

    We want to offer our customers DNS hosting with their domain name registrations. Therefor, we want to add the DNS zones to our main cpanel controlled cluster, so we can use the same nameservers.

    Because we want to avoid that a client accidentally deletes a DNS zone he hosted, but which meanwhile was tied to a hosting account, we want to put all these DNS zone under a reseller account that we created just for this.

    The reseller account has the add/removed/edit/park features added to his account, and when I log in to WHM using the reseller account, I can in fact create DNS zones, update them and delete them.

    However, the API returns that we have no privilege...

    CODE:
    Code:
    include("xmlapi.php"); 
    // Initialise the API
    $xmlapi = new xmlapi("serverName", "dnszone", "secret_password");
    // Force output to be JSON
    $xmlapi->set_output("json");
    echo $xmlapi->adddns("somedns3.be", "123.52.62.45");
    The result of the above code is:
    Code:
    {"status":0,"statusmsg":"Permission Denied"}
    It's probably an issue with the internals of the API in cPanel and not su much with this class, as I can make the call correctly, but I hope someone may know what is causing this...

  11. #56
    Registered User
    Join Date
    May 2010
    Posts
    1

    Default Permissions

    Not sure if something is wrong with the permissions.

    I have created a reseller account (using whm) and given it all permissions (apart from root permissions)

    However when using the api this account doesn't have all the permissions it should have. I only need a few functions but, of, course the one i don't have permissions for is the removeacct (to delete account). Which it definitely has privileges to do!

    I dont know if this is the api's fault or the class' (prob api?) but i cant seem to fix it. Its there if im root user or give the reseller account root access. I just dont want to give root access to the script "Just in Case".

    sigh,

    been working on making this script most of the day would really appreciate some help on it

    ty guys
    Last edited by helium; 05-21-2010 at 11:43 AM.

  12. #57
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    570

    Default

    Helium,

    Seems to work for me for a reseller with all boxes checked except the 'everything' root access

    Code:
    <?php
    //setup and vars
    include("xmlapi.php");
    $ip = "192.168.168.1";
    $root_pass = "rootsecret";
    $reseller = 'fptest';
    $reseller_pass = 'resellersecret';
    $acct = array( 'username' => "someone", 'password' => "pass123", 'domain' => "thisdomain.com");
    
    //instantiate and use root to remove the account, if it already exists
    $xmlapi = new xmlapi($ip);
    $xmlapi->password_auth("root",$root_pass);
    
    $xmlapi->removeacct('someone');
    
    //change auth and create account
    $xmlapi->password_auth($reseller,$reseller_pass);
    $result = $xmlapi->createacct($acct);
    
    //set debugging on and do the "real" test for this scenario
    $xmlapi->set_debug(1);
    $result = $xmlapi->removeacct('someone');
    ?>
    response:
    Code:
     [status] => 1
     [statusmsg] => someone account removed
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Requests

  13. #58
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    570

    Default

    Hi Speedpacket,

    This is a know issue and a fix is in the works for the xml-api binary to address this exact issue. To be clear, this has nothing to do with the PHP client class used in making the xml-api request to the server. Your code is sound.

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Requests

  14. #59
    Member
    Join Date
    Nov 2004
    Posts
    59

    Exclamation xmlapi and tokens? + incorrect shebang?

    --- moved ---
    Last edited by CaMer0n; 06-15-2010 at 11:42 PM.

  15. #60
    Registered User
    Join Date
    Jun 2010
    Posts
    4

    Default Php pear

    Is there any way to access PEAR or install PEAR packages through the api?

Page 4 of 8 FirstFirst ... 23456 ... LastLast

Similar Threads

  1. Replies: 1
    Last Post: 06-04-2011, 09:52 AM
  2. XML API class works with a WHM cPanel reseller account?
    By bcosmo in forum cPanel Developers
    Replies: 1
    Last Post: 03-17-2010, 09:33 AM
  3. Install wildcard ssl using XML API class
    By tomdchi in forum cPanel Developers
    Replies: 4
    Last Post: 02-21-2010, 07:58 PM
  4. WHM XML API ready to use class
    By arash_hemmat in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 07-18-2008, 05:03 AM