prevent specific characters from being used in password

Discussion in 'Customization & add-ons' started by skippybosco, Dec 22, 2010.

  1. skippybosco

    skippybosco CGI-Central Partner Staff Member

    Joined:
    Aug 22, 2006
    Messages:
    2,526
    looking to prevent users from using a few characters in their passwords which causes problems with a 3rd party application I'm integrating with.

    How can I prevent a user from entering in a: &, for example, as a part of their password?
  2. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Can be done with validate_signup_form hook
    PHP:
    setup_plugin_hook("validate_signup_form""vsf");
    function 
    vsf($vars){
       if(
    strpos($vars['pass0'], '&') !== false){
          
    $err[] = "Password should not have &";
       }
       return 
    $err
    }

Share This Page