Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
465 views
in Q2A Core by
I want the usernames to be formatted like: FirstnameLastNameClassyear.

i.e. johnsmith2011

Is there anyway to make the usernames automatic based on their information?  Or can is it possible to have them register and then I, as an admin, send them their username and password?

Basically, I don't want them to have any control of what their username is.  I want to avoid usernames such as: cooldude342

1 Answer

0 votes
by
You could modify the core-file qa-page-register.php:

You'll have to add fields for firstname, lastname and classyear in your example and you'll have to hide the field username.

If the user clicks register you could set the username to FirstnameLastnameClassyear and check if it's a unique username.

But your base problem remains: e.g. if sombody chooses cooldude as firstname...

Up to now you can only change the username directly in the database, there is no admin gui for it. Remember, if you change the username the original user can only login via email adress -- if you don't give him a note about the change this could be a little frustrating   ;)
by
@snoopy0815

Nice. I will try what you suggest for the qa-page-register.php file.

If I change the username directly in the database, why can they only login with their email?

I appreciate your help.
by
I just wanted to say that the user didn't get any automatic information, if you only change his username in the database. After you've informed them manually - they can of cause login again with the new name... until that they can still / only use the unchanged email as login...   ;)
...