Author Topic: How to Increase Username Length?  (Read 38810 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to Increase Username Length?
« on: August 24, 2015, 11:23:31 PM »
How to increase the username length from 8 to 16? Only 8 characters is very low...

Offline
*
Re: How to Increase Username Length?
« Reply #1 on: March 02, 2016, 09:43:14 AM »
I renew this question. I need  to set username longer than 8 characters. My configuration has domain/website per user so I need to  set username like a domain name but I can't because of this 8 characters restrict.

Is it possible to change the length of username or disable it? Centos by default allows 8/16/32 characters.

Thanks for help.

Offline
*
Re: How to Increase Username Length?
« Reply #2 on: March 02, 2016, 11:03:06 AM »

The source code of the add user part  has this:

 <td colspan='1'>Username:</td>
         <td colspan='1'><input type='text' name='username' size='10' maxlength='8'> (8 characters)</td>

I use the free hosting module to add users see http://wiki.centos-webpanel.com/freehosting-provider-service
And I have users with longer then 8 characters. Maybe you can use this free host module as temporary workaround
until CWP updates the add user part in the GUI.

Offline
*
Re: How to Increase Username Length?
« Reply #3 on: March 03, 2016, 07:42:06 AM »
Thanks for the answer. You are right. The HTML source code restrict maxlength to 8 characters. I can change it in flight with Chrome Element Inspector or FF Firebug and it's work but I need to change it with every add user action.

What is directory of this file with add user form? I  try to replace the HTML code. I know source files looks like one big hash but I will try to decode it.

The posibility with direct URL is not comfortable to work with them.

Another posibility is to create simple Javascript which replace value of maxlength element. I will inform you in this topic what is effect of this solution.

Offline
*
Re: How to Increase Username Length?
« Reply #4 on: March 03, 2016, 07:48:43 AM »
Ok guys I did it with Jquery overriding.
In this file /usr/local/cwpsrv/htdocs/resources/admin/modules/new_account.php under source code paste this:

Code: [Select]
<script type="text/javascript">
$(document).ready(function() {
$('input[name=username]').attr("maxlength", 32);
});
</script>
« Last Edit: March 03, 2016, 08:45:54 AM by piotrunioczko »

Offline
***
Re: How to Increase Username Length?
« Reply #5 on: March 03, 2016, 08:51:53 AM »
I hope you can make this, coz will much better if we can use full domain w/o dot as user name

Offline
*
Re: How to Increase Username Length?
« Reply #6 on: March 03, 2016, 09:40:44 AM »
Try this code above, and refresh site with cache refreshing. It's work. I have fully domain name as username in my CWP now.

Offline
*
Re: How to Increase Username Length?
« Reply #7 on: March 09, 2016, 08:03:04 AM »
If you use Jquery username length override You have to be carefull with MySQL database create. MySQL don't accept dots in database/user names. CWP creates database like username_database so You can't create dots in username like domain name (abc123.test.com) because MySQL don't like string with dots (abc123.test_database1).

So the best way to identificate home folder name or user name with domain without problem with MySQL db name is:

Example with domain abc123.test.com

1. Use Jquery username override.
2. Create username abc123 or abc123test with domain abc123.test.com
3. Create database abc123_database1, abc123_database2 etc.

And you will get:

1. Username abc123test
2. Home folder /home/abc123test
3. Domain abc123.test.com
4. Database abc123_database1

You have to create your own system names because it's depends of your vhosts name in CWP.

For now I think it's the easiest way to identificate username/database name with home folder name and domain name.

I will try to change restrict in database names with dots.
« Last Edit: March 09, 2016, 08:04:38 AM by piotrunioczko »

Offline
*
Re: How to Increase Username Length?
« Reply #8 on: May 20, 2017, 01:21:54 PM »
Hello


Where can I set the username limit..

Offline
*
Re: How to Increase Username Length?
« Reply #9 on: July 09, 2019, 01:00:16 PM »
Dear all,
CWP version: 0.9.8.847 is not working this method or I made a mistake..
Why it is blocked with 8 chars?? How can it be change/increase??
In the new_account.php (or other *acc* files) the script above is not working.. If paste it beofre the ioncube hash, it says the file was corrupted.. Probably it is not reading rest of the hash..
Is there anything to pass this restriction?
Thanks..

Offline
*
Re: How to Increase Username Length?
« Reply #10 on: September 06, 2020, 05:08:34 AM »
For anyone finding this on a google search, DO NOT DO IT.

There is a reason behind the character limit.
For example, if you had:
- domainname1.com
- domainname2.com

Say you create one account 'domainna' (following the 8char rule) but for the other 'domainname2' (following the unlimited character username hack).
Then you log into 'domainna', you will see all databases from the account 'domainname2' as well as your own, because the databases in 'domainname2' start with 'domainna'.

My not be an expected issue for many, but I just had a client with full access to delete other users databases.. which they did, as they didn't recognise them!

For the average user this is not an issue but just because you CAN do something, doesn't always mean you should :)
Hope it helps!

Offline
*
Re: How to Increase Username Length?
« Reply #11 on: September 28, 2020, 01:47:35 AM »
i have just found this is a problem for 2 cpanel sites we have where we need to import them into our development machine which runs CWP

the usernames are 9 characters long and identical other than the last letter, so we find we cannot import the second account to work on it...

makes life very difficult...

another issue is the interface limits usernames for databases to 7 characters

Offline
*
Re: How to Increase Username Length?
« Reply #12 on: November 16, 2020, 11:47:39 AM »
The solution here would be to have the ability to rename user accounts (and their databases to the new name) during account migration/import.

If you're reading this CWP chaps, please consider!  :)

Re: How to Increase Username Length?
« Reply #13 on: November 16, 2020, 02:23:57 PM »
For the average user this is not an issue but just because you CAN do something, doesn't always mean you should :)
Couldn't have said it better myself. For decades, 8 character limits have been a non-issue. Windoze bad habits have crept in like a virus! Next you'll be wanting them to be spaced out - see what I did there?  ???
« Last Edit: November 16, 2020, 02:25:39 PM by cynique »

Offline
*
Re: How to Increase Username Length?
« Reply #14 on: June 27, 2021, 08:19:05 AM »
I am migrating from cPanel on multiple servers. The 8 character username for a domain username is a deal breaker for me. I have a over 200 domains, and a dozen or so domain level2 names are identical, but have multiple TLDs for copyright / brand protection. Limiting a domain username to 8 characters is absurd in this modern age. From a Migration standpoint, this is moot issue for me.