Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

How to restrict user name fields

  • jpc0480
  • jpc0480
  • OFFLINE
  • Posts: 60
  • Thanks: 2
  • Karma: 1
12 years 2 hours ago #215798 by jpc0480
How to restrict user name fields was created by jpc0480
I'm now starting to get users who are creating user names with symbols like jpc@048, by doing this it forces the system to create a profile link to the users profile like: /userprofile/3209

My questions are:

1) How do I limit the text field at registration to allow only letters (Both upper and lower case) or a combination of letters and numbers? I would like to remove special characters from being allowed.

2) Now that I have 3-4 users with this and the user name field is read only, will they be allowed to change their name in this case or will it be ignored since the username field is read only?

What I would like to do is to force them to change their name to remove the symbols, but I don't want to lose any of their personal data, so will it change the link to their profile and still keep everything tied to them?

I'm using:
Kunena 3.0
CB 1.9
Joomla 2.5.11

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
11 years 11 months ago #215827 by krileon
Replied by krileon on topic Re: How to restrict user name fields

1) How do I limit the text field at registration to allow only letters (Both upper and lower case) or a combination of letters and numbers? I would like to remove special characters from being allowed.

Edit your text field and set "Authorized input:" to "Custom PERL regular expression" then set "Perl Regular Expression:" to "/[a-zA-Z0-9]*/" (without quotes)

2) Now that I have 3-4 users with this and the user name field is read only, will they be allowed to change their name in this case or will it be ignored since the username field is read only?

They can only change username if you allow username to be changed within CB > Configuration > User Profile and ensure the field isn't Read Only.

What I would like to do is to force them to change their name to remove the symbols, but I don't want to lose any of their personal data, so will it change the link to their profile and still keep everything tied to them?

Everything is linked to the user by their unique user id so changing username has no affect on this. Basically no they won't lose anything.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum