From: Bill Erickson Date: Wed, 28 Aug 2013 19:51:15 +0000 (-0400) Subject: TPAC honors opac.username_regex setting X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Ftpac-self-reg-improvements;p=evergreen%2Fequinox.git TPAC honors opac.username_regex setting If a value for requested username is entered and the org unit setting "opac.username_regex" has a value, the regex will be enforced just like the other .regex org unit settings in use in self-reg. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm index cf6a987d97..0b68f1aa65 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Register.pm @@ -183,6 +183,11 @@ sub collect_register_validation_settings { $ctx->{get_org_setting}->($ctx_org, 'ui.patron.edit.phone.regex') unless $shash->{stgu}{day_phone}{regex}; + # The regex OUS for username does not match the format of the other + # org settings. Wrangle it into place. + $shash->{stgu}{usrname}{regex} = + $ctx->{get_org_setting}->($ctx_org, 'opac.username_regex'); + # some fields are assumed to be visible / required even without the # presence of org unit settings. E.g. we obviously want the user to # enter a name, since a name is required for ultimately creating a user