Re: [qmailtoaster] password complexity and length

2018-04-04 Thread Jeff Koch
You can insert javascript password rules in the html code templates for 
qmailadmin.


Here's a simple password strength javascript that goes in the top of 
mod_user.html




function passwordStrength(password)
{
    var desc = new Array();
    desc[0] = "Very Weak";
    desc[1] = "Weak";
    desc[2] = "Better";
    desc[3] = "Medium";
    desc[4] = "Strong";
    desc[5] = "Strongest";

    var score   = 0;

    //if password bigger than 7 give 1 point
    if (password.length > 7) score++;

    //if password has both lower and uppercase characters give 1 point
    if ( ( password.match(/[a-z]/) ) && ( password.match(/[A-Z]/) ) ) score++;

    //if password has at least one number give 1 point
    if (password.match(/\d+/)) score++;

    //if password has at least one special characther give 1 point
    if ( password.match(/.[!,@,#,$,%,^,&,*,?,_,~,-,(,)]/) ) score++;

    //if password bigger than 12 give another 1 point
    if (password.length > 12) score++;

document.getElementById("passwordDescription").innerHTML = desc[score]; document.getElementById("passwordStrength").className = "strength" + score;

 if (score > 2 ) {
   document.getElementById("btnSubmit").disabled = false;
 }else{
   document.getElementById("btnSubmit").disabled = true;
 }

 return score;
}



then further along in the code we have:

  
    name="password2" maxlength=128 size=16>

  
    
  
    Password 
strength:
    id="passwordDescription">Password not entered

  
  
    
    
    
    
    
  

Passwords must be at least eight characters and 
include three of the following four types: upper case letters, lower 
case letters, numbers and special characters.





Regards, Jeff








On 4/4/2018 6:51 PM, Gary Bowling wrote:



Last time I checked it was either not possible or not easy to 
implement password rules one the toaster. But that was a long time ago.



Has anything changed in that regard?

--

Gary Bowling
- 
To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com 
For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com 




[qmailtoaster] password complexity and length

2018-04-04 Thread Gary Bowling

  
  


Last time I checked it was either not possible or not easy to
  implement password rules one the toaster. But that was a long time
  ago. 



Has anything changed in that regard?

-- 
  
  Gary Bowling

  


-
To unsubscribe, e-mail: qmailtoaster-list-unsubscr...@qmailtoaster.com
For additional commands, e-mail: qmailtoaster-list-h...@qmailtoaster.com