Skip to main content

cPanel api 2 for mysql remote whitelist

Comments

8 comments

  • cPanelMichael
    Hello, Yes, this function is documented here:
    0
  • gruant2000lewis
    Awesome ! Thank you very much.
    0
  • gruant2000lewis
    I have one more question, I notice in the docs that This function only returns a reason value if it failed. I want to test my logic for failure.... is there a value that I can put in it that WILL produce a failure? Just wanted to get a failure so I can make sure that end is covered.
    0
  • cPanelMichael
    Hello, Sure, simply enter a value such as "$$$". Thank you.
    0
  • gruant2000lewis
    Sorry for being a pest. I thought I had this all working but I have now hit another issue. Using this... $newdomain = "12.345.45.678"; $myemails = $xmlapi->api2_query($account, "MysqlFE", "authorizehost", array('host'=>$newdomain) ); I am able to add 12.345.45.678 to my access hosts list through the above code. I logged into cPanel to verify. But when I test the connection, I actually have no access. If I remove the ip address manually in cPanel....then manually add it again in cPanel.....then my connection works.
    0
  • cPanelMichael
    Hello, Does it work if you use the function directly in your web browser (e.g. with the WHM API (JSON) example on the document provided earlier)? Thank you.
    0
  • gruant2000lewis
    I have never tried that, and not even sure how to structure that. I have always used the method that I showed above. Does that json method still use the xmlapi.php file? I tried looking for a basic implementation, but couldn't find an example. This is the basic way I am doing it currently.
    password_auth($account, $passwd); $xmlapi->set_port(2083); $xmlapi->set_output("simplexml"); $newAuthIP = "123.45.67.890"; <----- sanitized value from a form post $myemails = $xmlapi->api2_query($account, "MysqlFE", "authorizehost", array('host'=>$newAuthIP) ); ?>
    0
  • cPanelMichael
    Hello, I'm referring to the "WHM API (JSON)" example listed at:
    0

Please sign in to leave a comment.