Author Topic: How to Increase Username Length?  (Read 5059 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..