Hello
Is it possible to automatically assign new members a username? I need to assign a number in ascending order to all new registrants as their username.
Thanks for your help
Last edit: 10 years 5 months ago by PresidenteMensaMexico.
You can use CB Auto Actions and a Query action, Code action, or Field action to accomplish this. Which method you use is up to you. Query could be a direct query to _users to alter the row of the user. Code could be a Joomla API or preferably CB API call to change and store the user. Field would do the storing for you, but you won't be able to really do any logic here.
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.
The proposed solution was similar: "use a Code action on the before registration trigger and alter the POST of username to whatever you want".
In my case, I need the username to be 10 random digits. Does anyone know what a PHP code would look like that would accomplish this (that I can put into the Auto Action code section)?