svbeek

Registered
Jul 28, 2004
4
0
151
Netherlands
When i try to create a user using the php api createacct function i get the following error:

Results of your request

WWWAcct 8.0 by J. Nick Koston

Please use the this syntax
wwwacct

Account Creation Complete!!!
And the account isnt created. I couldnt find a proper solution on these forums nor google, so i hope anyone can help me out. I'm convinced my paramters are correct, since listing users etc. works great. Is this a bug in the scripts?

My code:

require("accounting.inc.php");

$host = "<server.domein.tld>";
$adminuser = "root";
$whmkey = "<my little secret>";
$plan = "Pakket 1";
$username = "testelex";
$password = "testelex";
$cres = createacct ($host, $adminuser, $whmkey, 1, "testdomain.nl", $username, $password, $plan);
print_r($cres);
Disabling ssl doenst make any difference..
 

fwwebs

Well-Known Member
Feb 16, 2004
329
0
166
Try using variables rather than plain text for all entries. Is your Accounting file in the same directory as your script?
 

svbeek

Registered
Jul 28, 2004
4
0
151
Netherlands
This is just a test, thats why i have those hardcoded values. And yes, it is. I'm sure the call is made.. you could make that up out of my post, please give me answers that are of use to me.
 

fwwebs

Well-Known Member
Feb 16, 2004
329
0
166
This is just a test, thats why i have those hardcoded values. And yes, it is. I'm sure the call is made.. you could make that up out of my post, please give me answers that are of use to me.
The variables are not being passed or you've not posted a complete "Results of your request". Furthermore "require("accounting.inc.php");", is incorrect. If you made a copy of the Accounting.inc.php and moved it to web accessible directory, that may be your problem. Start with the basics, use the original file, and the original variables and work you way towards the modifications.
 

svbeek

Registered
Jul 28, 2004
4
0
151
Netherlands
Ok, one line of the output is missing indeed, here's the full output:

WWWAcct 8.0 by J. Nick Koston

Please use the this syntax
wwwacct <domain> <user> <pass> <quota> <cpmod[advanced/?]> <ip[y/n]> <cgi[y/n]> <frontpage[y/n]> <maxftp> <maxsql> <maxpop> <maxlst> <maxsub> <bwlimit> <hasshell[y/n]>

Account Creation Complete!!!
But i still havn't made any progress.. And why should require() be incorrect ? Using include() doesnt make any difference in the result.
 

fwwebs

Well-Known Member
Feb 16, 2004
329
0
166
#!/usr/local/cpanel/3rdparty/bin/php
<?php
require "/usr/local/cpanel/Cpanel/Accounting.php.inc";
$host = 'localhost';
$user = 'root';
$accesshash = '<my little secret>';
$usessl='1';
$acctdomain= 'domainte.com';
$acctuser = 'domainte';
$acctpass = 'passwd';
$acctplan = 'Pakket 1';

createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);

?>
A few points.
1. Change the domain your trying to use to something that doesn't begin with test.
2. Use localhost, unless your attempting to create an account on a remote host. If you are, load the script on you're cpanel server and try it from there first.
3. Ensure that the plan exists.
4. Try the above script on your server and see if it works.
 

svbeek

Registered
Jul 28, 2004
4
0
151
Netherlands
I found what the problem was. I got the accounting.php.inc file from someone who downloaded it with IE. Somewhere in that process the & characters in the file got replaced by &amp;, so the url's in the cpanel funtions got screwed up. Pretty stupid, i know.
Thanks for trying to help me.
 

fwwebs

Well-Known Member
Feb 16, 2004
329
0
166
Sorry I should have been more direct, I kind of beat around the bush. The best way to verify the script is loading the script on the server that your creating the accounts on and using the original Accounting.inc.php file and work your way from there. Of course if everything is right to start, the script should work on a remote server. Glad to hear it's working. Take care.