[users] Sort the password checks before applying them

This commit is contained in:
Adriaan de Groot 2019-11-08 13:21:37 +01:00
parent dec0cfb7d3
commit e11c9a049f
3 changed files with 10 additions and 0 deletions

View file

@ -424,6 +424,12 @@ UsersPage::checkPasswordAcceptance( const QString& pw1, const QString& pw2, QLab
bool failureIsFatal = ui->checkBoxValidatePassword->isChecked();
bool failureFound = false;
if ( m_passwordChecksChanged )
{
std::sort( m_passwordChecks.begin(), m_passwordChecks.end() );
m_passwordChecksChanged = false;
}
for ( auto pc : m_passwordChecks )
{
QString s = pc.filter( pw1 );
@ -502,6 +508,8 @@ UsersPage::setReusePasswordDefault( bool checked )
void
UsersPage::addPasswordCheck( const QString& key, const QVariant& value )
{
m_passwordChecksChanged = true;
if ( key == "minLength" )
{
add_check_minLength( m_passwordChecks, value );