Loading...
 
Features / Usability

Features / Usability


Changing Username Character Pattern causes failure to register

posts: 175 Canada

Hi Tikians,

We ran into a problem with @ symbols in a username (when use email as login is NOT selected).

To get around this, and also prevent users from putting spaces in usernames I tried to edit the username pattern in the Login Admin.

Here's the default according to the dev pages:

Copy to clipboard
/^() '-_a-zA-Z0-9@\.*$/


Now, I tried just removing the space and @ like so:

Copy to clipboard
/^()'-_a-zA-Z0-9\.*$/


but when I used that, ALL registration attempts return "invalid username".

Then I tried going back to
Copy to clipboard
/^() '-_a-zA-Z0-9@\.*$/


But all registrations continued to fail. I cleared the tiki caches without effect. Panicking, I removed all and left the field blank. Now registrations work, but now the whole keyboard is available for usernames, which is what we didn't want.

How do we limit the usernames to one word, alphanumeric only?

Thanks!

p.s. How does the registration form ajax gizmo know what are valid usernames? Is is supposed to use the pattern in the login admin panel, or is there a separate javascript somewhere? Because it didn't seem to notice when I changed the pattern in the admin.

posts: 8633 Israel

Is there a solution or a guide somewhere about it ?

I'm trying to modify the pattern so it get's hebrew char... so far no good.

i tried:

Copy to clipboard
/^[ '\-_a-zA-Z0-9@\.]*$/א-ת~/ /^[ '\-_a-zA-Z0-9@\.]*$/אבגדהוזחטיכךלמםנןסעפףצץקרשת /^[ '\-_a-zA-Z0-9@\.]*$/[אבגדהוזחטיכךלמםנןסעפףצץקרשת]


Didn't work.

I believe some have already tried this (french accents) but i can't find a guide on the TW doc.


posts: 8633 Israel

Well, thanks to Gil i got it right now:

Copy to clipboard
/^[ '\-_a-zA-Z0-9@\.א-ת]*$/


This pattern suggest it is possible to have an empty name (even if TW will not allow it) so it's better we correct this and put it right with the + sign which forces at least 1 character in the name.

Copy to clipboard
/^[ '\-_a-zA-Z0-9@\.א-ת]+$/