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.

Createaccount question(s)

Discussion in 'General Discussion' started by ChadK, Sep 2, 2004.

  1. ChadK

    ChadK Registered

    Joined:
    Aug 31, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    When a new user verifies his email address, I want to set up a tiny little web space for them.

    Some things I'm still having trouble with on my site when creating default webspaces for users is:

    The users name. If it has _ or punctuation etc, cpanel strips that information out when creating the account so the account login isn't identical. I'd like to force them to use more restrictive user names when registering to ensure it's compatible with CPanel. This is a software issue on my end of course. (Invision Power Board)

    The email address when creating an account is blank. I'd like it to populate with the address they registered with. I also need to add an email that sends them their login information and instructions on using their new site. I saw http://www.premierwebsitesolutions.com/scripts/postwwwacct/#2 but I have no idea how to use that from PHP... yet. Sounds like I need a php version of this because I don't own the server I'm on so I doubt I can write this script to the scripts directory mentioned on that page. Also, perhaps it's possible to have one script accomplish both tasks? Create the account AND email the user?
    Code:
    //Create default web-space
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = "localhost";
    $user = "your_WHM_account_name";
    $accesshash = "Your accesshash without any comments.";
    //this is created on your WHM panel
    $domain=$member['uname'].".aviary.info";
    //for me, I am going to create a default space
    //for every user when they validate their account
    //on my site.
    $username=$member['uname'];
    //This also would be changed to suit your needs.
    $pass=$member['pass'];
    $plan="youraccount_free";
    //the default plan for the user
    //my _free plan is very very basic with only 
    // a few features available.
    $useSSH=0;
    //set this to 1 if using this api call from 
    //another domain/server
    createacct ($host,$user,$accesshash,
    $useSSH,$domain,$username,$pass,$plan);
    //end default web-space
     

Share This Page