Skip to Content Skip to Menu

Autogenerate username

10 years 7 months ago #243155 by rogerbodger
Autogenerate username was created by rogerbodger
Hello,

My client has a requirement to automatically generate a username at registration time. The username needs to be generated in a particular format, there is some flexibility to the format but inclusion of the date (yyyymmdd) is a must. My thinking is to either generate the username field before displaying the registration form (and prohibit editing of username), or to hide the username field and generate after registration form submission. Can someone either point me to where I can code this myself, or confirm if an addon will do this for me.

I've seen other posts suggesting that the incubator addon CB Auto Actions might be an option, although those other posts are for different requirements (for example generate a random username) and information about the plugin is limited ahead of purchasing professional membership (which I'm happy to do if the plugin will definitely meet my needs).

Thanks in advance,
Roger

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 7 months ago #243165 by nant
Replied by nant on topic Autogenerate username

rogerbodger wrote: Hello,

My client has a requirement to automatically generate a username at registration time. The username needs to be generated in a particular format, there is some flexibility to the format but inclusion of the date (yyyymmdd) is a must. My thinking is to either generate the username field before displaying the registration form (and prohibit editing of username), or to hide the username field and generate after registration form submission. Can someone either point me to where I can code this myself, or confirm if an addon will do this for me.

I've seen other posts suggesting that the incubator addon CB Auto Actions might be an option, although those other posts are for different requirements (for example generate a random username) and information about the plugin is limited ahead of purchasing professional membership (which I'm happy to do if the plugin will definitely meet my needs).

Thanks in advance,
Roger


Yes, Professional membership, CB Auto Action and some PHP code can get this done.

you can use a Code action on the before registration trigger and alter the POST of username to whatever you want.. that's one way of doing it

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

  • mhs_cb
  • mhs_cb
  • OFFLINE
  • Posts: 53
  • Thanks: 0
  • Karma: 0
10 years 3 months ago #247604 by mhs_cb
Replied by mhs_cb on topic Autogenerate username
This is exactly what I'm looking for. Except I simply want to generate 10 random digits as the username.

Can someone be so kind as to give me a the PHP code that will alter the POST of username to 10 randomly generated digits?

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
10 years 3 months ago #247635 by nant
Replied by nant on topic Autogenerate username

mhs_cb wrote: This is exactly what I'm looking for. Except I simply want to generate 10 random digits as the username.

Can someone be so kind as to give me a the PHP code that will alter the POST of username to 10 randomly generated digits?


Please start new support thread in Professional support forum.

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

Moderators: beatnantkrileon
Powered by Kunena Forum