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.

Multiple Users, Same Name, Same Server?

Discussion in 'General Discussion' started by doni49, Apr 12, 2007.

  1. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    I'm a reseller. I'm using the Accounting.php file to create & otherwise manage user accounts.

    When I create an account, I have to provide a username & domain name for the account. What happens if the chosen username is in use by someone else under a different reseller account or under my provider's main account?

    I know about the listaccounts function, but that only lists the accounts tied to MY reseller account. Can two users have the same username if they're under different reseller accounts?

    If there CAN NOT be multiple accounts with the same username, is there anyway for me as a reseller to find out if the requested username is available?

    Also, what happens if the customer is moving an existing account from another provider to my service--but what he doesn't realize is that his current host is my provider? I see that as a case where the user could potentially be trying to create a new acct using a domain name that is in use by ANOTHER account on the same server.

    Any thoughts suggestions for handling these two issues?

    TIA!
     
  2. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Because I don't want to set up the users manually.

    I'm using a PHP script to create the account the instant payment is received.
     
  3. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    why don't you rather just logon to WHM and create accounts there?
     
  4. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    ok, so you're not using something like Modernbill, Clientexec, Solid State, etc?

    Then, take a look on hotscripts.com, there' are a few scripts that do this, with paypal integration. Eitherway, you could see how it works by looking at their scripts :)
     
  5. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Thanks. I found one on hotscripts that looks like it might be decent. Assuming the author coded it properly, it seems that as long as they are with diff resellers, there CAN be multiple users on the server.

    But that still doesn't help me figure out what happens if a user tries to create an account using a domain name that is already stored on that server (but with a diff reseller).
     
  6. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Currently, in WHM, you get an error after the account is created, saying that username is already taken, regardless of which reseller has created it.

    So, how about doing some checks, before creating the account?
     
  7. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Well that's EXACTLY what prompted me to post my original message. HOW can I check to see if a if a username/domainname is in use? As a reseller, I don't have access to the list of ALL usernames/domainnames on the server. The listaccounts function only shows me accounts hosted under MY reseller account.

    I'm starting to think that maybe this belongs as a feature request on bugzilla.

    i.e. They should add a function whereby I would pass it a username and it would return TRUE if the username is available and FALSE if the username is NOT available. Same for the domain name.

    I'm still puzzled as to HOW to go about dealing with someone wanting to move his domain from another provider to mine and they'd be on the same server.

    What I'm getting at is imagine that you have your domain hosted at hostxyz.com. You decide to move to doni49.com (not the real domain). What you don't know is that hostxyz.com and doni49.com are both resellers on the same server. You attempt to sign up at doni49.com and I have to tell you "that domain is already hosted on this server".
     
  8. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    BTW since I don't know any username/domainname for any account not under MY reseller acct, I can't very well test to see for myself what happens. That's why I'm asking y'all.
     
  9. gorilla

    gorilla Well-Known Member

    Joined:
    Feb 3, 2004
    Messages:
    699
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Sydney / Australia
    maybe u just need your own dedicated server then, so something silly as this wont happen ;)
     
  10. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Well when I have enough business to support that, I WILL. But I'm trying to figure out what to do in the meantime. I'm surprised it's never come up before.
     
  11. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    I'm just rereading your first post, seeing that you are the reseller, and can't see other users on the system. This in itself, if you think about it carefully, is a security "safetynet", not just from a dedicateds server owner's point of view, but also from a linux point of view.

    Seeing that cPanel needs to be installed as root, and have full access to everything, the script runs with various layer of security, allowing it to see if an account already exists.


    Check the script, and see if this does this check, or not.

    A few ways of checking, evey with limited access:

    Code:
    ls /home/{username-in-question}
    
    finger {username-in-question} [B]Caution: this might raise a security concern with your host, or might be disabled[/B]
    
    wget http://1.2.3.5/{username-in-question}
    
    

    All three of these could be used in a simple if script to see if the user exists or not.



    If it's really a problem, upgrade to a VPS, which will give you root access, and is normally in the region of $10 - $20 more than the average reseller account :)
     
Loading...

Share This Page