marcos

Member
Feb 24, 2003
5
0
151
brazil
I ´m new in this area, and i´d like to know where i can put a account creation scripts?Could be a www directory? I have a reseller account and i´d like thay my buddy could create account too, but i ´dont want give him my password.

Does some one could help me?
 

jimcarter

Well-Known Member
Jun 30, 2002
152
0
166
UK
Hi,
This may take a bit of coding but the only thing you can do besides give him your password is to setup an account creation area,
if you take a look at this documentation here:
http://www.cpanel.net/manual/remoteaccess-php.html
You could submit the variables $acctuser, $acctpass and $acctplan from a html form which would enable him to create an account with the details needed,
only problem would be that a plan would already need to be created with the specs that suit him,
the more features you require, the more coding it takes,
if you spend time on it though, you can come up with a really cool system, I recently finished coding a system allowing my resellers to create reseller accounts of their own through a small separate control panel,
works very nice :D
 

marcos

Member
Feb 24, 2003
5
0
151
brazil
i need this !!!

Thanks Jim, i follow the example in cpanel.net to create account, but the script doesn´t return anithing. I put this script in www directory and the plan i have ever configurated in WHM. When i run a script, after i reload my list plain from whm , but doesn´t work.

supose this script is create.php


PHP:--------------------------------------------------------------------------------
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$host = "localhost";
$user = "user";
$accesshash = 'ACCESSHASH';
$usessl = "1";
$do = createacct($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);
if (!eregi("wwwacct creation finished",$do)){
echo "There has been a problem with your account creation!<br>Please contact support for help!";
}
else
{
Header("Location: success.html");
}

i call this manner

www.mydomain.com/create.php

is all right?


see you


Marcos
 

jimcarter

Well-Known Member
Jun 30, 2002
152
0
166
UK
Yes that would be the correct way to call that script,
you should make sure that you have entered all the variables correctly, if you do not have curl for php installed change the usessl variable to 0
i.e. $usessl = 0;
make sure that you have entered your accesshash correctly also,
Thanks
 

marcos

Member
Feb 24, 2003
5
0
151
brazil
socket

I tried to use a create account script but
I ´m having problem with socket_create() function , that´s a not definied function. How can i solve this.

Thank´s


Marcos
 

marcos

Member
Feb 24, 2003
5
0
151
brazil
thank´s so much

My problem is socket. PHP have a problem because socket is not stable. i run phpinfo() and sockets are enable but is not truth()!!!

I run the script from the other host and had success!

Thank´s Jim because i didn´t have curl() but this is only necessary if you use usessl=1 .This information is very important because Cpanel.net only say that you need curl() but socket can work very well :)