Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

How to change password policy at the time of registration

0 votes
55 views
asked Mar 7 in Q2A Core by anonymous
So I want to provide a better security for users. to achieve this I need to ask users to put a Password of at least 6 character and should have at least 1 upper case. How can I do this from Admin Panel.

1 Answer

0 votes
answered Mar 8 by Scott

To set the minimum password length you can put this in your qa-config.php file:

define('QA_MIN_PASSWORD_LEN', 8);

However, 8 is already the default in Q2A (since v1.8.0). I'd suggest keeping that and not changing it to 6 as that is less secure.

For changing password requirements you'll need to make a filter plugin with a validate_password function. Something along the lines of

public function validate_password($password, $olduser)
{
    if (!preg_match('/[A-Z]/', $password)) {
        return 'Password must contain at least 1 uppercase character';
    }
}
...