diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 4025f5c..8c078fc 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -207,6 +207,10 @@ function load() { input.widget.attr('disabled', true).attr('readOnly', true); } + dojo.connect(generatePassword, 'onClick', generatePasswordHandler); + if (uEditUsePhonePw) { + generatePassword.attr('disabled', true); + } if(!patron.isnew() && !checkGrpAppPerm(patron.profile()) && patron.id() != openils.User.user.id()) { // we are not allowed to edit this user, so disable the save option @@ -326,6 +330,16 @@ function replaceCardHandler() { patron.cards(t); } +/** + * Generate a random password for the patron. + */ +function generatePasswordHandler() { + uEditMakeRandomPw(patron); + var f = findWidget('au', 'passwd'); + f.widget.attr('value', patron.passwd()); + f = findWidget('au', 'passwd2'); + f.widget.attr('value', patron.passwd()); +} /** * Loads a staged user and turns them into something the editor can understand diff --git a/Open-ILS/web/templates/default/actor/user/register_table.tt2 b/Open-ILS/web/templates/default/actor/user/register_table.tt2 index 30eeb5c..e8672a5 100644 --- a/Open-ILS/web/templates/default/actor/user/register_table.tt2 +++ b/Open-ILS/web/templates/default/actor/user/register_table.tt2 @@ -19,7 +19,12 @@ - + + + + + + Verify Password