1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Make username not unique?

Discussion in 'XenForo Questions and Support' started by The Forum Heroes, Sep 2, 2013.

  1. The Forum Heroes

    The Forum Heroes Well-Known Member

    How can I make the username not unique and make logging in strictly via e-mail address?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Yikes...

    I would have thought that's a pretty extensive change...

    But one thing you could try in a completely isolated test board is removing the unique index on the username field with this query:

    Code:
    ALTER TABLE `xf_user` 
    DROP INDEX `username`
    I haven't even begun to think about the problems this could cause, though, so please do proceed with caution.

    There's quite a few cases, I think, where XenForo assumes the username is unique so I think this could require some pretty extensive development. I know why you want to do it though... Just a big task, I think.
     
    The Forum Heroes likes this.
  3. The Forum Heroes

    The Forum Heroes Well-Known Member

    Great thanks, I'll let you know how it goes and if I hit any bumps.
     
  4. Mike

    Mike XenForo Developer Staff Member

    Yeah, bad idea. Think about conversations, user searches, tagging, find by user, etc. Everything user facing in XF is geared around usernames.
     
  5. The Forum Heroes

    The Forum Heroes Well-Known Member

    @Mike When I tag you, isn't it just like profile? Displays "Mike" but it alerts Mike.3?
     
  6. Mike

    Mike XenForo Developer Staff Member

    You just tagged "Mike" -- the system found the ID from the name. What if there are 2 Mikes?
     
  7. The Forum Heroes

    The Forum Heroes Well-Known Member


    Revisiting this as I finally got around to this project idea again.. Trying to create a second user with same username it says User names must be unique. The specified user name is already in use. I did the alter you gave me to drop the index.
     
  8. The Forum Heroes

    The Forum Heroes Well-Known Member

    Woot.. with a few core file edits it works! Registering normal or using FB connect :)

    usernames.png
     
  9. The Forum Heroes

    The Forum Heroes Well-Known Member

    Any sggestions on if I was to tag Test1 how to make both registered appear in the popup to select, not just the lowest user_id one
     
  10. Chris D

    Chris D XenForo Developer Staff Member

    Frankly, no.

    We're still of the opinion that this is a pretty bad idea from a technical point of view. And this issue you're experiencing now is just one of the problems you will face.

    The system is designed to expect that usernames are unique. If you remove that constraint then you're going to find numerous things that stop working as expected.
     

Share This Page