From: miker Date: Thu, 23 Sep 2010 15:34:10 +0000 (+0000) Subject: Forward-port of a patch from Steve Callendar, via James Fournie, via launchpad: X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9f5407be49b6e9578f34d9a6c672067043486a25;p=working%2FEvergreen.git Forward-port of a patch from Steve Callendar, via James Fournie, via launchpad: When the patron.password.use_phone is set, new patrons are created with their password set to the last 4 digits of their phone number, HOWEVER, when a patron's password is reset, it does not work properly. Although the little underlined summary shows the proper 4 digits, the password box displays 9-ish digits, and is not the last 4 digits of the password. The attached patch was created by Steve Callender and is confirmed working on 1.6.0 This patch will not work on 2.0 as that has a new user editor, but it would presumably be worthwhile to verify this functionality works in that editor as well. git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_1@17921 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/patron/ue.js b/Open-ILS/xul/staff_client/server/patron/ue.js index d31b117d4b..650211c4c4 100644 --- a/Open-ILS/xul/staff_client/server/patron/ue.js +++ b/Open-ILS/xul/staff_client/server/patron/ue.js @@ -285,13 +285,26 @@ function uEditMakePhonePw() { } } -function uEditResetPw(pw) { - if(!pw) pw = uEditMakeRandomPw(patron); - $('ue_password1').value = pw; - $('ue_password2').value = pw; - $('ue_password1').onchange(); +function uEditResetPw(pw) { + if(!pw) { + if(uEditUsePhonePw) { + if( (pw = patron.day_phone()) || + (pw = patron.evening_phone()) || (pw = patron.other_phone()) ) { + pw = pw.substring(pw.length - 4); // this is iffy + uEditResetPw(pw); + appendClear($('ue_password_plain'), text(pw)); + unHideMe($('ue_password_gen')); + } + } else { + pw = uEditMakeRandomPw(patron); + } + $('ue_password1').value = pw; + $('ue_password2').value = pw; + $('ue_password1').onchange(); + } } + function uEditClone(clone) { var cloneUser = fetchFleshedUser(clone);