Allowing dots in usernames

Discussion in 'Troubleshooting' started by bennyuk1, Dec 14, 2017.

Thread Status:
Not open for further replies.
  1. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    190
    We've imported 1000+ users into new amember site. Just realised they all have dots in the usernames.

    Is there a we can allow usernames to be valid with dots in them?

    site is integrated with WordPress.

    Thanks
    Ben
  2. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    190
    Do I need to add te following to the site.php file?
    PHP:
    Am_Di::getInstance()->hook->add(Am_Event::GET_LOGIN_REGEX, function(Am_Event $e) {
      
    $e->setReturn('/^[-0-9a-zA-Z_@.]+$/D');
    });
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    1,794
    Yes, this code looks correct.
  4. bennyuk1

    bennyuk1 aMember Pro Customer

    Joined:
    Jan 12, 2012
    Messages:
    190
Thread Status:
Not open for further replies.

Share This Page