jaychennai Posted October 21, 2014 Share Posted October 21, 2014 /** * Check for password validity for capitals * * @param string $passwd Password to validate * @return boolean Validity is ok or not * @author VEKIA :-) http://MyPresta.eu */ public static function isPasswdPro($passwd){ if (preg_match('/[A-Z]/',$passwd)){ return true; } else { return false; } } /** * Check for password validity * * @param string $passwd Password to validate * @param int $size * @return boolean Validity is ok or not */ public static function isPasswd($passwd, $size = Validate::PASSWORD_LENGTH){ if ((Tools::strlen($passwd) >= $size && Tools::strlen($passwd) < 255) && Validate::isPasswdPro($passwd)){ return true; } else { return false; } } I used the above code by VEKIA to force users to use alphanumeric passwords while registering , but i keep getting passwd invalid error , for what ever password i use Any suggestions regards Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now