gravitygr

Registered
Feb 27, 2007
1
0
151
Hi. I searched for this but found nothing unfortunately.
I wonder if there is a way to use a php script (or built my own using some existing API) to add an IP in the Remote Database Access Hosts.
I have to connect with a special software from different ip's on my database and wish not to add %.

Thanx,
Achilles
 

DaveUsedToWorkHere

Well-Known Member
Dec 28, 2001
686
1
318
You can do this in conjunction with the XML API. You'll need to use CURL to call this function:

https://$domain:2083/xml-api/cpanel?xmlin=<cpanelaction><module>Mysql</module><func>addhost</func><args>$host</args></cpanelaction>

You'll need to pass the cPanel account username and password in the headers of the request to authenticate.

More XML API docs here: http://www.cpanel.net/plugins/xmlapi