0 Sorry that username (Account-Name) is taken. Check /etc/passwd

spicerje

Registered
May 16, 2008
1
0
51
The following function works, but it gives an error. It looks like it creates the account and then checks to see if it exists and then throws an error because the account it just created already exists?

The account and user are created. It appears that the function returns without an error, but when I print the status it displays the error.

0 Sorry that username (Account-Name) is taken. Check /etc/passwd


function createacct2 ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctemail,$acctplan) {
$result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&contactemail=${acctemail}&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=${acctplan}",$host,$user,$accesshash,$usessl);
if ($cpanelaccterr != "") { return; }
return $result;
}
---------the call to the function------------------
$status = createacct2 ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctemail,$acctplan);
if ($status)
{

print_r($status);
}

I do not have direct access to /usr/local/cpanel so I am unable to modify or view any of the scripts located here. I just have a reseller account and my hosting company does not grant this access.

Also the API being discussed here will most likely not work for me I want to automate a solution so that the account is created by the end user. Since it appears that the API requires the whm login this will not work. If there is a way to automate the API like the account.php.inc so that a normal user can execute the API call that would be ok. Just remember I have very limited access with my reseller account. Go figure. I know once
I move to a dedicate or vm server I will get more access. I just can not justify the cost yet
while I am still learning.

Thanks,

Jeff
 

DaveUsedToWorkHere

Well-Known Member
Dec 28, 2001
686
1
318