• Hi there,

    Im about to roll out a change on one of my sites that allows users to review their current employer! However, i intend to bypass the registration process and as such would like to make the user_login the actual job title of the reviewer! For example, if an engineer reviews company a, ill set the user_login to engineer, with a random password and a null email id unless he/she wants to set one!

    However, if a second reviewer who is an engineer, his/her user_login will also be engineer ! I know i can set other values like nicename, but this will mean modifying a bunch of code! My question here is does having users user_login value set to the same value cause problems to the core of wp functions?

    If you are struggling to understand feel free to check out the site at https://www.reviewrecruiter.com.au !

    Id greatly appreciate any knowledge on this as im sort of reluctant start inserting values into the wp_users database without knowing im not going to kill the beats?!

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you create and ‘engineer’ user, you will end up having all of your ‘engineer’ reviewers be the exact same WordPress user. You won’t be able to distinguish between them and you won’t be able to store things like email addresses for more than one of them (and you won’t really know who the address belongs to). The fact that you are talking about setting the ’email id’ makes me think this isn’t going to work the way you want.

    If you try to create multiple ‘engineer’ users– distinct rows in the wp_users table– you will have to do it with hand written INSERT queries because the WordPress user functions will look for duplicate usernames and reject attempts to create them. Try to register on a WordPress blog using a name that already exists. If you do bully multiple usernames into the databse, I expect that you will break any number of functions that expect unique/distinct usernames.

    My vote is that you are probably causing yourself a lot a trouble. How has this worked in testing?

    Thread Starter razorharrison

    (@razorharrison)

    In testing it seemed to work ok, but my main concern was the impact such a change might have on potential upgrades or other plugins.

    In the end I used a timestamp(time) . $userip to create a unique user_login

    Beyond this I used the display_name as the occupation field and update it on the fly. The issue with this entire model is that once registered/created, the user_login name is a numerical value. However, I dont really use these user names as regular log-in name anyway, so should be all good.

    Any significant problems, crashes, etc, etc, I’ll update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multiple user_login with the same value ! Will this cause issues?’ is closed to new replies.