Numeric usernames / numeric membership ID's.

10 years 6 months ago - 10 years 6 months ago #152046 by rebreanu
Hello everybody.

I wish to have a feature on CB backend admin with the option (check box) "Use numeric usernames as users ID's" and a field with e.g. "user range ID's starting from 10001 (variable, the range must be completed by admin depending on how many users he thinks to have on the website) and end with (variable) 99999.

This means if I check this box and fill the start and end ID range, when a new user register on the website, he only complete the name field, email field and pass/verify pass fields. When the user hit the Register button, the CB script gives to this new user the next numeric ID available in user ID table which will be used by joomla, CB and all others plgins as USERNAME (yes, numeric usernames, read old posts on the forum about this!).

E.g. The user John Smith will get an email after his registration with the following:

"Thank you for registering on bla bla bla.
You can now login with your email address xxx@yyy.zzz and the pass 12345 OR YOU CAN LOGIN WITH YOUR MEMBERSHIP ID 468578 (and this is THE USERNAME for joomla, CB, kunena and all others plugins that need the username from the user table/database in order to work properly) and your pass 12345 to register."

In the most cases, everybody will use the email / pass combination to login on the site. If someone will use his numeric ID /pass combination it is good as well.

PLEASE READ ABOUT THE FUNCTIONALITY!

If we use this feature, we do not longer need to have "bibi123" or "gogothemasteroftime12" usernames on our sites and have real names for the braves users or DECENT NUMERIC MEMBERS ID's for the users that want to stay anonymous.

ALSO, WE GET RID OF THE (annoying) USERNAME FIELD FROM REGISTRATION PAGE (the numeric value for the username will be assigned automatically by the CB script on registration).

If enough peoples will read/vote my post maybe someday CB team (and I count on krileon for this) will implement this great feature.

Thank you.
The following user(s) said Thank You: BlackSunel, Saphy

Please Log in to join the conversation.

10 years 6 months ago #152396 by BlackSunel
Replied by BlackSunel on topic Re: Numeric usernames / numeric membership ID's.
This is an awesome idea! Hope the CB team will have this in mind!

Please Log in to join the conversation.

10 years 6 months ago #153249 by rebreanu
SOLVED!

CB have this great feature out of the box! I only installed CB Fields plugin (can be found on Incubator area, professional membership only access).

In the CB Fields plugin I made the following trigger in less than a minute:

onAfterUserRegistration >field 'username'> set value equal to> [user_id]

or

onAfterUserRegistration >field 'username'> set value equal to> [firstname][user_id]

or

onAfterUserRegistration >field 'username'> set value equal to> After setting this, go to CB Configuration Manager > User profile and on the 'Username' option set it to 'No', and users will not be able to change the username after registration, and because of this the username will remain unique. After this go to CB Configuration Manager > General and on the 'Login field type' option set it to 'Email only' and that's it! No more username field! Thank you nant & krileon for your answers :) ! p.s. Please read [url=https://www.joomlapolis.com/forum/154-advanced-members-support/151682-solved-can-i-use-this-hack-for-email-as-username#151682]this post[/url] . It is about email as username but you will get the idea of using the unique joomla user ID or any other field value as you wish as username, without needing the username field on the registration form![email]

After setting this, go to CB Configuration Manager > User profile and on the 'Username' option set it to 'No', and users will not be able to change the username after registration, and because of this the username will remain unique.

After this go to CB Configuration Manager > General and on the 'Login field type' option set it to 'Email only' and that's it! No more username field!

Thank you nant & krileon for your answers :) !


p.s. Please read this post . It is about email as username but you will get the idea of using the unique joomla user ID or any other field value as you wish as username, without needing the username field on the registration form!
The following user(s) said Thank You: nant

Please Log in to join the conversation.

10 years 6 months ago #153266 by nant
Once again - THANK YOU for sharing your solution with the rest of the community.

Please Log in to join the conversation.

10 years 3 months ago #160620 by justmebg
I needed something similar and used a similar solution. I set a trigger to change a Member ID field to a prefix plus the Joomla unique member ID. I would prefer an autonumber that does not match any part of the Joomla id number, but this solution is certainly better than manually assigning member numbers like I used to!

Beth G

Please Log in to join the conversation.

10 years 2 months ago #165046 by houfton
I have just used this technique and it is great for new registrations, thank you.

I am trying to work out how to use it to change all my 500 existing Users' usernames to id numbers in one go. Any ideas?

Is there a trigger which acts simultaneously on all Users? I tried setting up an onAfterSyncUser and then did a Tools>Synchronize Users but nothing happened.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.442 seconds

Facebook Twitter LinkedIn