Username Don't Allow dots

Permalink
Hi:
If anyone can help me. I noticed that C5 does't allow user to register usernames with " . " (dots).
If there anyway i can allow user to use it?

Thanks

fjhadd
 
ronyDdeveloper replied on at Permalink Best Answer Reply
ronyDdeveloper
You need to navigate to the below path:

ROOT/concrete/core/controllers/single_pages/ and there you find a file called register.php, copy that file to the below path:
ROOT/single_pages/

Then open the register.php for editing and change the below line
class Concrete5_Controller_Register extends Controller {

with this one
class RegisterController extends Concrete5_Controller_Register{

this line should be at line no 2 or 3. Then go to line no 82 and you will find the below code
if (strlen($username) >= USER_USERNAME_MINIMUM && !$valc->username($username)) {
if(USER_USERNAME_ALLOW_SPACES) {
   $e->add(t('A username may only contain letters, numbers and spaces.'));
} else {
   $e->add(t('A username may only contain letters or numbers.'));
}
}

Just remove that piece of code and save. That's it. It will allow you to add username containing {.}dots.


Rony
fjhadd replied on at Permalink Reply
fjhadd
Hi thank you for your response. The Register.php file is in ROOT/concrete/core
Where should i put that on the Root?
Blenderite replied on at Permalink Reply
Blenderite
I think you should leave it where it is. Just save it once you make those changes Rony told you about.
fjhadd replied on at Permalink Reply
fjhadd
ok thank you it worked
fjhadd replied on at Permalink Reply
fjhadd
The only change is that if you change this line
class Concrete5_Controller_Register extends Controller {

Does't work.
Blenderite replied on at Permalink Reply
Blenderite
I notice you have a space between Controller and {. That is probably the problem.
RoyS replied on at Permalink Reply
RoyS
This is a very bad solution as it disables all checks against usernames. The better solution is here:

http://www.concrete5.org/community/forums/usage/usernames-no-longer...