rfe #2657696 Automatically copy generated password

This commit is contained in:
Marc Delisle
2009-05-04 16:32:16 +00:00
parent 55a516e39c
commit 70c6e5a32c
4 changed files with 4 additions and 18 deletions

View File

@@ -71,8 +71,7 @@ function checkAddUser(the_form)
/**
* Generate a new password, which may then be copied to the form
* with suggestPasswordCopy().
* Generate a new password and copy it to the password input areas
*
* @param string the form name
*
@@ -90,19 +89,7 @@ function suggestPassword() {
for ( i = 0; i < passwordlength; i++ ) {
passwd.value += pwchars.charAt( Math.floor( Math.random() * pwchars.length ) )
}
return passwd.value;
}
/**
* Copy the generated password (or anything in the field) to the form
*
* @param string the form name
*
* @return boolean always true
*/
function suggestPasswordCopy() {
document.getElementById('text_pma_pw').value = document.getElementById('generated_pw').value;
document.getElementById('text_pma_pw2').value = document.getElementById('generated_pw').value;
document.getElementById('text_pma_pw').value = passwd.value;
document.getElementById('text_pma_pw2').value = passwd.value;
return true;
}