Decrease MAX_LENGTH_USERNAME from 16 to 8 - cPanel ver 11.44
Dears,
I've searched for how to decrease the max length for username on cPanel ver 11.44.1 from 16 to 8 characters.
I've changed for /usr/local/cpanel/whostmgr/docroot/templates/createacct.tmpl
and
/usr/local/cpanel/whostmgr/docroot/templates/createacmaxlength="8"ct2.tmpl
for line maxlength="16" to maxlength="8".
I'm also change the MAX_LENGTH_USERNAME var on this file
/usr/local/cpanel/whostmgr/docroot/templates/accounts/createacct.min.js
and
/usr/local/cpanel/whostmgr/docroot/templates/accounts/createacct.js
Now, When i try to write username it's actually saved for 8 characters only, But when i'm standing on the domain field and try to click TAP button on key board, it's copy all of domain characters to username field with 16 characters !
Kindly advise any help me.
-
[quote="Eltawoos, post: 1704162">Dears, I've searched for how to decrease the max length for username on cPanel ver 11.44.1 from 16 to 8 characters. I've changed for /usr/local/cpanel/whostmgr/docroot/templates/createacct.tmpl and /usr/local/cpanel/whostmgr/docroot/templates/createacmaxlength="8"ct2.tmpl for line maxlength="16" to maxlength="8". I'm also change the MAX_LENGTH_USERNAME var on this file /usr/local/cpanel/whostmgr/docroot/templates/accounts/createacct.min.js and /usr/local/cpanel/whostmgr/docroot/templates/accounts/createacct.js Now, When i try to write username it's actually saved for 8 characters only, But when i'm standing on the domain field and try to click TAP button on key board, it's copy all of domain characters to username field with 16 characters ! Kindly advise any help me.
First off as a warning I believe cPanel update may overwrite any changes you make, so keep an eye out on that. That said, your browser autofill may be ignoring the maxlength attribute. What browser and version are you using? Also it looks like you only need to modify createacct.min.js(it is built automatically and distributed with WHM but we leave the original createacct.js there in case you want to poke around). To test instead of trying to tab autofill type out a domain length and see if it throws validation warnings for being larger than 8 characters.0 -
[quote="cPAndrewHodge, post: 1704542">First off as a warning I believe cPanel update may overwrite any changes you make, so keep an eye out on that. That said, your browser autofill may be ignoring the maxlength attribute. What browser and version are you using? Also it looks like you only need to modify createacct.min.js(it is built automatically and distributed with WHM but we leave the original createacct.js there in case you want to poke around). To test instead of trying to tab autofill type out a domain length and see if it throws validation warnings for being larger than 8 characters.
When i try to modify "createacct.min.js" i don't see any affcted on the WHM !! Please advice if i need to run any commands after change on "createacct.min.js"0 -
Hello Eltawoos, I wrote a WHM hook to do just that, as the new length limit was causing problems internally. If you want to take a look at it, it's available here: /https://github.com/santium/cPanel/tree/master/UserLength 0
Please sign in to leave a comment.
Comments
3 comments