Im writing a php application for a client and it would be very nice for him if I could have it create an email account for his domain via php instead of having to log into the vm control panel to do this as a 2nd step.
That looks like it will work fine once I am able to access the remote api via http. I have gone into webmin and granted this user access to “Can accept RPC calls?” however I still receive an “ERROR: You are not allowed to run remote commands” error.
This also worked fine using curl under php5. Again it works for root user but not domain user. Maybe it will help someone. I just need to get it working using the domain owner.
//init curl and set options
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://mydomain.com:10000/virtual-server/remote.cgi');
curl_setopt($ch, CURLOPT_USERPWD, 'root:rootpass');
//using self signed ssl cert, so dont verify
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_TIMEOUT , 300);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_POST, TRUE);
//set command to execute here
curl_setopt($ch, CURLOPT_POSTFIELDS, ‘program=list-domains’);