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

Requiring "First Last" name for registrations

Discussion in 'XenForo Pre-Sales Questions' started by grc, Dec 24, 2010.

  1. grc

    grc Member

    Our vB forum has a strong "reunion" component so from the beginning we've required people to use real names as their user name. Somewhere along the line I set it up to require two word user names (must have a space): Firstname[space]Lastname. On vB it's called "Username Regular Expression." We also manually approve registrations.

    A side benefit that has been very helpful is that requiring a [space] in the username cut down spam registrations by 99%.

    So, my question is, does XF support requiring a [space] in the registration process?
     
  2. steven s

    steven s Well-Known Member

    Judging by my username, spaces are allowed.
    Commas are not allowed which may pose a problem with prefixes.

    I misunderstood.
    I see an option.

    • User Name Match Regular Expression:

      This requires the user names of new registrations to match the given regular expression.
    Added: <sigh> I was looking up the answer and was beaten to it while editing my post.
     
    grc likes this.
  3. Dean

    Dean Well-Known Member

    It supports regex in the same way I believe. Though I've not tried requiring a space.

    • User Name Match Regular Expression:

      This requires the user names of new registrations to match the given regular expression.
     
    grc likes this.
  4. grc

    grc Member

    Thanks for the quick replies. It's a challenge to think about switching software packages for an online community that has been going for 13 or 14 years. We started with a Matt's Scripts forum. Then moved to Ceilidh and ran it for several years before going to vBulletin around 6 years ago. I don't need for XF to mimic vB - if I did, I'd just stay put. At the same time, I'm trying to think of real world vB features I don't think we can be with out.
     
    Dean likes this.
  5. steven s

    steven s Well-Known Member

    I forgot about Matt's Scripts. Started with that one too. Then UBB-->phpBB2-->vBulletin3/4.
    The reason I will eventually convert my vB forums over is for speed. My vB3 site is running OK but I have never changed the styling.
    With XF, it is so easy. My vB4 site is sluggish. Lots of queries in the CMS section. High server loads.

    XF is just refreshing. The subculture is so much better than where we are coming from.
     
    grc likes this.
  6. Jaxel

    Jaxel Well-Known Member

    You don't look like Steve Gibson...
     
  7. master412160

    master412160 Member

    I think if it stops 99% of the spam its a must to do.
     
  8. steven s

    steven s Well-Known Member

    O/T But if you re getting a lot of spam elsewhere, you do not have enough safeguards in place. I get spam attempts every 5 minutes on my vB3 forum but very few register.
    And those that do register go into moderation so my members don't even see the post.
     
  9. grc

    grc Member

    It's the combination. Most spam 'bots can't figure out how to register with two names. Then, we do manual registrations, so they are looked by a real person before they're approved.

    Also, I have a couple of custom questions that are asked.

    I didn't know how much good all that was doing until I had to do a fresh install. Before I could tweak all the settings I had been found by the bots.
     
  10. Itworx4me

    Itworx4me Well-Known Member

    What is the expression to get Firstname[space]Lastname?
     
  11. James

    James Well-Known Member

    I've not used XF's system, but this should work: \w+ \w+
     
  12. grc

    grc Member

    I don't understand it, but someone gave me this one and it works:
    ^[a-zA-Z ]+[\s]+[a-zA-Z]+$
     
  13. James

    James Well-Known Member

    ^ = start of regex
    [a-zA-Z ]+ = allow uppercase and lowercase letters and a space (allow multiples of each, hence the +)
    [\s]+ = whitespace (space/tab/etc)
    [a-zA-Z]+ = multiple uppercase/lowercase (notice no space)
    $ = end regex

    Hope that helped.
     
    grc likes this.
  14. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    You might want to try using instead
    Because the [\s]+ would match several spaces, this means that it will accept
    John[space]Doe
    and
    John[space][space]Doe

    If you only require one space between words the + sign after the space is not needed
    XenForo may prevent that anyway, but I am not sure.
     
    grc likes this.
  15. James

    James Well-Known Member

    True, but in the start of his regex: "[a-zA-Z ]+", spacing is allowed multiple times so it's screwed there anyway unless spacing is removed from the first part of the regex.
     
    grc likes this.
  16. Rigel Kentaurus

    Rigel Kentaurus Well-Known Member

    Oh .... that I didn't see. Yes, the expression should only be [a-zA-Z]+ without the space then. Actually, I think that regex would match not only FIRST LAST but also FIRST MIDDLE LAST and any number of words actually
     

Share This Page