RFE #1197482, password generator on user creation. RFC: ok like that? TODO: add strings.
This commit is contained in:
@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
|
|||||||
$Id$
|
$Id$
|
||||||
$Source$
|
$Source$
|
||||||
|
|
||||||
|
2005-05-17 Olivier Mueller <om@omnis.ch>
|
||||||
|
* server_privileges.php, libraries/server_privileges.js: RFE #1197482,
|
||||||
|
password generator on user creation. RFC: ok like that? TODO: add strings.
|
||||||
|
|
||||||
2005-05-15 Marc Delisle <lem9@users.sourceforge.net>
|
2005-05-15 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* sql.php, libraries/sqlparser.lib.php: bug #1120434, comment at the end
|
* sql.php, libraries/sqlparser.lib.php: bug #1120434, comment at the end
|
||||||
of query is applied to appended LIMIT as well
|
of query is applied to appended LIMIT as well
|
||||||
|
@@ -86,3 +86,46 @@ function setCheckboxes(the_form, the_checkboxes, do_check)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
} // end of the 'setCheckboxes()' function
|
} // end of the 'setCheckboxes()' function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate a new password, which may then be copied to the form
|
||||||
|
* with suggestPasswordCopy().
|
||||||
|
*
|
||||||
|
* @param string the form name
|
||||||
|
*
|
||||||
|
* @return boolean always true
|
||||||
|
*/
|
||||||
|
function suggestPassword(the_form)
|
||||||
|
{
|
||||||
|
var pwchars = "abcdefhjmnpqrstuvwxyz23456789ABCDEFGHJKLMNPQRSTUVWYXZ.,:";
|
||||||
|
var passwordlength = 16; // do we want that to be dynamic? no, keep it simple :)
|
||||||
|
var passwd = '';
|
||||||
|
|
||||||
|
for (i=0;i<passwordlength;i++)
|
||||||
|
{
|
||||||
|
passwd+=pwchars.charAt(Math.floor(Math.random()*pwchars.length))
|
||||||
|
}
|
||||||
|
|
||||||
|
document.forms[the_form].generated_pw.value = passwd;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy the generated password (or anything in the field) to the form
|
||||||
|
*
|
||||||
|
* @param string the form name
|
||||||
|
*
|
||||||
|
* @return boolean always true
|
||||||
|
*/
|
||||||
|
function suggestPasswordCopy(the_form)
|
||||||
|
{
|
||||||
|
document.forms[the_form].pma_pw.value = document.forms[the_form].generated_pw.value;
|
||||||
|
document.forms[the_form].pma_pw2.value = document.forms[the_form].generated_pw.value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -548,6 +548,20 @@ function PMA_displayLoginInformationFields($mode = 'new', $indent = 0)
|
|||||||
. $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
|
. $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
|
||||||
. $spaces . ' <input type="password" name="pma_pw2" id="text_pma_pw2" class="textfield" title="' . $GLOBALS['strReType'] . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
|
. $spaces . ' <input type="password" name="pma_pw2" id="text_pma_pw2" class="textfield" title="' . $GLOBALS['strReType'] . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
|
||||||
. $spaces . ' </td>' . "\n"
|
. $spaces . ' </td>' . "\n"
|
||||||
|
. $spaces . '</tr>' . "\n"
|
||||||
|
. $spaces . '<tr>' . "\n"
|
||||||
|
. $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
|
||||||
|
. $spaces . ' <label for="text_pma_pw2">' . "\n"
|
||||||
|
. $spaces . ' ' . $GLOBALS[''] . 'Generate Password:' . "\n"
|
||||||
|
. $spaces . ' </label>' . "\n"
|
||||||
|
. $spaces . ' </td>' . "\n"
|
||||||
|
. $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
|
||||||
|
. $spaces . ' <input type="button" value="Generate" onClick="suggestPassword(\'usersForm\', \'generated_pw\')">' . "\n"
|
||||||
|
. $spaces . ' <input type="button" value="Copy" onClick="suggestPasswordCopy(\'usersForm\')">' . "\n"
|
||||||
|
. $spaces . ' </td>' . "\n"
|
||||||
|
. $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
|
||||||
|
. $spaces . ' <input type="text" name="generated_pw" id="generated_pw" class="textfield"/>' . "\n"
|
||||||
|
. $spaces . ' </td>' . "\n"
|
||||||
. $spaces . '</tr>' . "\n";
|
. $spaces . '</tr>' . "\n";
|
||||||
} // end of the 'PMA_displayUserAndHostFields()' function
|
} // end of the 'PMA_displayUserAndHostFields()' function
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user