Username with only numbers?

15 years 5 months ago #79516 by okhansen
Replied by okhansen on topic Re:Username with only numbers?
Hi Peter

Try this, it solved it for me in Joomla:

forum.joomla.org/viewtopic.php?t=254200


Also this one for CB:

www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/view,threaded/id,77954/catid,43/

It works perfectly for all my 2500 members
:whistle:
Cheers

Ole

Odense, Denmark

Post edited by: okhansen, at: 2008/11/12 23:04

Please Log in to join the conversation.

15 years 5 months ago #79642 by noerkjaer
Replied by noerkjaer on topic Re:Username with only numbers?
Hmm.
I looked at those two fixes, but can't get the CB part to work.
It works via the Joomla user-panel but in CB it doesn't work.

I might not have edited the right places, as the postings are about passwords, and I need to have the usernames to be 6 numbers.

Ole, if you have a working CB-file, any chance you would mind to share it? B)

Please Log in to join the conversation.

15 years 5 months ago #79680 by okhansen
Replied by okhansen on topic Re:Username with only numbers?
Hi Peter

It's quite simple. All you got to do is:

- Edit comprofiler.html.php
- Search for RegExp
- Add 0-9 like this(underline): ("^[a-zA-Z0-9](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i");

Remark that RegExp is in the Javapart, and that you wil find RegExp three times. First time I only change the first RegExp in my search, but it first worked for me after I changed the second RegExp.:whistle:

Save and enjoy the result

Best regards

Ole

Please Log in to join the conversation.

15 years 5 months ago #79717 by noerkjaer
Replied by noerkjaer on topic Re:Username with only numbers?
I can see the RegWxp 3x3 times.
Should I edit all ofI can see the RegExp 3x3 times.
Should I edit all of them?

EDIT: Sorry for the short reply. But I've tried to post like 20 times now, but I keep getting an error, so this was just a test...
Seems the forum won't allow me to paste code.

However:

I can see the RegExp line in three areas - each place with three lines.

The last area of the 3 is named something with "username" (Line 1214 and forth).
The three lines goes like this:
[code:1]
var r = new RegExp("^[a-zA-Z0-9](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i"«»);
var r = new RegExp("[^A-Za-z0-9]", "i"«»);
var r = new RegExp(" **different signs/symbols** ", "i"«»);
[/code:1]
Turns out it was the signs on the third line that triggered the forum.

I've edited the first line. But how about the second and third?

På forhånd tak!

Regards Peter them?

Post edited by: noerkjaer, at: 2008/11/14 17:52

Post edited by: noerkjaer, at: 2008/11/14 17:54

Please Log in to join the conversation.

15 years 5 months ago #79758 by noerkjaer
Replied by noerkjaer on topic Re:Username with only numbers?
Finally!!! Now it works!!! :woohoo: :woohoo: :woohoo:

I forgot that when messing with usernames therer might be just a file or two in the "Administrator" part that is in use as well.

So I looked in the "root/administrator/components/com_comprofiler/" folder and found a filed named "admin.comprofiler.html.php".

Guess what... :whistle: At line 1760 RegExp only said A-Za-z
So I added 0-9 and now it works!!!
Line 1760 should read
[code:1] var r = new RegExp("^[a-zA-Z0-9](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i"«»);
[/code:1]

And I owe Ole a pint!

Regards

Peter
Aalborg, Denmark

Please Log in to join the conversation.

15 years 4 months ago #80910 by viper_iii
Replied by viper_iii on topic Re:Username with only numbers?
I followed the last post to the T... and it worked...

I brought over my users using UserPort component. Simple CSV.

from there I needed to go into cb and approve users... however because My user names are 3 digits (hey not my idea on that one) I couldn't edit them in the administration because there wasn't any alpha characters...

simple fix with that first post!

Thanks again!

Funny this forum is reversed! Originally thought the solution was first then not last. Just different format!!

noerkjaer wrote:

Finally!!! Now it works!!! :woohoo: :woohoo: :woohoo:

I forgot that when messing with usernames therer might be just a file or two in the "Administrator" part that is in use as well.

So I looked in the "root/administrator/components/com_comprofiler/" folder and found a filed named "admin.comprofiler.html.php".

Guess what... :whistle: At line 1760 RegExp only said A-Za-z
So I added 0-9 and now it works!!!
Line 1760 should read
[code:1] var r = new RegExp("^[a-zA-Z0-9](([\.\-a-zA-Z0-9@])?[a-zA-Z0-9]*)*$", "i"«»);
[/code:1]

And I owe Ole a pint!

Regards

Peter
Aalborg, Denmark


Post edited by: viper_iii, at: 2008/11/29 20:33

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.227 seconds

Facebook Twitter LinkedIn