The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'General Discussion' started by spicerje, May 16, 2008.

  1. spicerje

    spicerje Registered

    Joined:
    May 16, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
Loading...

Share This Page