1

When I try to login, my usernames are treated as case sensitive. As in if username is john and I try entering John, it is not accepted.

Is it possible if I could make all the characters lower case before they could be submitted?

Thanks

1

Using hook_user_insert, you can convert every letter of username to lower case once a user is being created. Then when a user is submitting the login form, you can convert its username field to lower case. So from now on all of the usernames will be in lower case it is no longer case sensitive

  • 3
    Just a note, you also need to disable permission to edit usernames (Change own username) for that users group. Because if you not, this hook will not be sufficient and you will need to use hook_user_update also. – Juraj Nemec Mar 17 '16 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.