From a595f4094d4776723b53786faf51bcda03ecfaab Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Fri, 18 Sep 2015 14:17:07 -0400 Subject: [PATCH] Add button to reset password via email Add button to user editor to request a password reset link be sent via email. Signed-off-by: Jeff Godin --- Open-ILS/src/templates/actor/user/register_table.tt2 | 6 +++++- Open-ILS/web/js/ui/default/actor/user/register.js | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/actor/user/register_table.tt2 b/Open-ILS/src/templates/actor/user/register_table.tt2 index d3f19a05b1..7680853808 100644 --- a/Open-ILS/src/templates/actor/user/register_table.tt2 +++ b/Open-ILS/src/templates/actor/user/register_table.tt2 @@ -23,7 +23,11 @@ - + + + + + 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 fe7a201878..8de7aa6582 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -87,6 +87,7 @@ function load() { allCards.attr("label", localeStrings.SEE_ALL); dojo.byId('uedit-dupe-username-warning').innerHTML = localeStrings.DUPE_USERNAME; generatePassword.attr("label", localeStrings.RESET_PASSWORD); + requestPasswordResetViaEmail.attr("label", 'Send Password Reset Link'); setExpireDate.attr("label", localeStrings.UPDATE_EXPIRE_DATE); dojo.byId('verifyPassword').innerHTML = localeStrings.VERIFY_PASSWORD; dojo.byId('parentGuardian').innerHTML = localeStrings.PARENT_OR_GUARDIAN; @@ -303,6 +304,8 @@ function load() { dojo.connect(generatePassword, 'onClick', generatePasswordHandler); + dojo.connect(requestPasswordResetViaEmail, 'onClick', requestPasswordResetViaEmailHandler); + dojo.connect(setExpireDate, 'onClick', setExpireDateHandler); if(!patron.isnew() && !checkGrpAppPerm(patron.profile()) && patron.id() != openils.User.user.id()) { @@ -609,6 +612,18 @@ function generatePasswordHandler() { f.widget.attr('value', patron.passwd()); } +function requestPasswordResetViaEmailHandler() { + if (patron.email()) { + var resp = fieldmapper.standardRequest( + ['open-ils.actor', 'open-ils.actor.patron.password_reset.request'], + { params : ['barcode', patron.card().barcode(), patron.email()] } + ) + alert('Submitted request for password reset link to be sent via email.'); + } else { + alert('Patron must have email address on file to perform a password reset via email.'); + } +} + /** * Generate a potential usrname for the patron. */ -- 2.11.0