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.

Valid usernames

Discussion in 'cPanel Developers' started by NLCJ, Sep 29, 2015.

  1. NLCJ

    NLCJ Member

    Joined:
    Sep 25, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Currently I am creating a website which communicates with WHM via the WHM API 1. At this moment I am creating a username verifier (to check whether it is valid and available) since there is no API function for it (right?).

    At the API documentation page of creating an account it says the following:
    Just now I created a new user via the WHM interface with username 'fakeaccount' - 11 characters, I am running WHM 11.50.1 and have database prefixes enabled. Is this restriction recently removed?

    Besides that; is there a place where I can find a list of reserved usernames? Currently the most recent list I found is from this topic (started in 2011).
     
  2. cPDavidN

    cPDavidN cPanel Developer
    Staff Member

    Joined:
    Mar 19, 2013
    Messages:
    42
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    Hello,

    Thanks for contacting us. If I understand how this works, that shouldn't be allowed to happen. My understanding could be incorrect, so I'll ask for clarification.

    If you're running on a cPanel & WHM server, you can use the Perl module Cpanel::Validate::Username to check if a username is valid before making your API call. There is documentation in /usr/local/cpanel/Cpanel/Validate/Username.pod on how to use it.

    If you have any other questions about this, please don't hesitate to ask.

    David Nielson
    Integration Developer, cPanel
     
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,384
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I think the first 8 characters of a username have to be unique.

    Which, if you ask me, kind of negates the point of allowing 16 character long usernames.

    I'm really not sure what was wrong with the 8 character username restriction to begin with.
     
  4. NLCJ

    NLCJ Member

    Joined:
    Sep 25, 2009
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This is correct; see the message below (directly copied from the 'Create a new account' function in WHM 11.50.1 - build 3). Perhaps the documentation needs to be updated?

     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There's no longer an 8-character limit for usernames, regardless of if database prefixing is enabled. However, the first eight characters of any username must be unique. Only the first eight characters of the username are utilized for database names and database usernames when database prefixing is enabled (e.g. cp123456 is the database prefix if the account username is cp123456789). This decision was made because administrators have the option to enable or disable database prefixing at will in "WHM >> Tweak Settings". I've opened a case (DOC-6266) with our documentation team to correct the document referenced in this thread.

    Thank you.
     
Loading...
Similar Threads - Valid usernames
  1. Killy123
    Replies:
    4
    Views:
    91
  2. Tcalp
    Replies:
    3
    Views:
    596

Share This Page