Hi,
Sorry to bother you but I was advised by Matt at WHMCS to contact you regarding the problems I am having with the API. I am currently using GPL but as soon as I can get auto creation/suspend working I do plan to purchase Pro.
Here is a copy of my correspondence with Matt:
"Hi Curtis,
Ok so based on this we can see the URL, request WHMCS is passing and response coming back from VirtualMin which in this case is "Unknown option y62hIk3i5H". The variable it's quoting there is the account password not an option so I think you'll need to get Virtualmin themselves to take a look at this for you as it seems to be something up on their side.
Regards,
Matt"
"Hi Matt,
I have enabled $debug_output and it now says this: URL: https://server.example.com:10000/virtual-server/remote.cgi?
Data: program=create-domain&domain=test.example.com&user=test&pass=y62hIk3i5H&email=&template=Default+Settings&plan=Standard&default-features=&
Response: Unknown option y62hIk3i5H
Adds a new Virtualmin virtual server, with the settings and features specified on the command line.
virtualmin create-domain --domain domain.name --pass password-for-unix-user | --passfile password-file [--parent domain.name | --alias domain.name | --superdom domain.name] [--desc description-for-domain] [--email contact-email] [--user new-unix-user] [--group new-unix-group] [--unix] [--dir] [--dns] [--mail] [--web] [--ssl] [--logrotate] [--mysql] [--spam] [--virus] [--webmin] [--virtualmin-awstats] [--default-features] | [--features-from-plan] [--allocate-ip | --ip virtual.ip.address | --shared-ip existing.ip.address] [--ip-already] [--allocate-ip6 | --ip6 virtual.ip.address] [--ip6-already] [--dns-ip address | --no-dns-ip] [--max-doms domains|] [--max-aliasdoms domains] [--max-realdoms domains] [--max-mailboxes boxes] [--max-dbs databases] [--max-aliases aliases] [--quota quota-for-domain|UNLIMITED] [--uquota quota-for-unix-user|UNLIMITED] [--bandwidth bytes] [--template "name"] [--plan "name"] [--limits-from-plan] [--prefix username-prefix] [--db database-name] [--fwdto email-address] [--reseller name] [--mysql-pass password] [--skip-warnings] [--field-name value]
Exit status: 256"
Many thanks,
Curtis
Comments
Submitted by JamieCameron on Mon, 06/06/2011 - 15:41 Comment #1
Could you post the line that gets logged to /var/webmin/miniserv.log when the API call to Virtualmin is made by WHMCS ? It should contain remote.cgi .
Submitted by cgdhosting on Tue, 06/07/2011 - 17:43 Comment #2
xx.xxx.xx.xxx - curtis [07/Jun/2011:23:37:46 +0100] "POST /virtual-server/remote.cgi? HTTP/1.1" 200 2366
Submitted by JamieCameron on Tue, 06/07/2011 - 18:07 Comment #3
Ok, I see the cause of this now - WHMCS is passing an empty
email=
parameter, which confuses the Webmin API. This either needs to be set to an actual email address, or omitted completely.Submitted by andreychek on Wed, 06/08/2011 - 10:08 Comment #4
What Jamie's saying here is that, if there isn't an email address to pass in -- rather than passing a blank parameter, WHMCS would need to pass no parameter at all. That would require a code change within WHMCS.
As for a quick fix in the meantime -- is it possible for you to set an email address parameter from within WHMCS? That way, WHMCS would have something to pass in, avoiding the problem you're seeing.
Submitted by JamieCameron on Wed, 06/08/2011 - 12:48 Comment #5
As a work-around, you can edit the file
/usr/share/webmin/virtual-server/create-domain.pl
and replace the line :$email = shift(@ARGV);
with :
if ($ARGV[0] !~ /^-/) {
$email = shift(@ARGV);
}