Username-disallow symbols

Discussion in 'Troubleshooting' started by walshie, Aug 24, 2007.

  1. walshie

    walshie New Member

    Joined:
    Aug 24, 2007
    Messages:
    6
    Hi,

    can anyone tell me how to disallow users from using symbols (including spaces) in their username and password when they sign up.

    all i want them to be able to use is letters and numbers

    thanks,

    walshie
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Modify this in signup.php:
    if ($config['login_disallow_spaces'])
    $preg = '/[^0-9a-zA-Z_]/';
    else
    $preg = '/[^0-9a-zA-Z_ ]/';

    to
    if ($config['login_disallow_spaces'])
    $preg = '/[^0-9a-zA-Z]/';
    else
    $preg = '/[^0-9a-zA-Z]/';
  3. walshie

    walshie New Member

    Joined:
    Aug 24, 2007
    Messages:
    6
    Thanks Alexander,

    that works for the username but not the password.

    Walshie

Share This Page