Bugzilla – Attachment 171981 Details for
Bug 36430
Allow self-registering users to set their own userid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36430: Allow self-reg users to set userid
Bug-36430-Allow-self-reg-users-to-set-userid.patch (text/plain), 5.63 KB, created by
Shi Yao Wang
on 2024-09-26 14:49:23 UTC
(
hide
)
Description:
Bug 36430: Allow self-reg users to set userid
Filename:
MIME Type:
Creator:
Shi Yao Wang
Created:
2024-09-26 14:49:23 UTC
Size:
5.63 KB
patch
obsolete
>From 4a0a9a72ca342863e48afdb24235051a9b29f3b4 Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Mon, 5 Aug 2024 17:57:36 +0000 >Subject: [PATCH] Bug 36430: Allow self-reg users to set userid > >This patch adds the ability for patrons to set their userid when self registering. It also gives patrons the ability to request changes to their user id from the OPAC. > >To test: >1) Apply patch, restart_all >2) Make sure the 'PatronSelfRegistration' system pref is set to allow and make sure you have a 'PatronSelfRegistrationDefaultCategory' category set. >3) Visit the OPAC main page and select 'Create an account' >4) Under the 'Library' section, you should see a new 'Username: ' input. Fill out the required information and leave the username blank. >5) Submit the form. Your userid should automatically be set. Copy/remember this userid that was given to you >6) Create a new account, this time fill in a custom userid with the value given to the patron you just created >7) When submitting, you will see an error message, as the userid is not unique. >8) Change the userid to somethign different and submit the form. >9) Form submits successfully and gives you the desired userid. Log into this account >10) Click the 'Personal details' tab and submit an update request for the username. Ensure this works correctly. >11) Play around with the other self registration system preferences ('PatronSelfRegistration'...) to attempt to hide/require the userid field and ensure they all work properly. > >Signed-off-by: Shi Yao Wang <shi-yao.wang@inlibro.com> >--- > .../bootstrap/en/modules/opac-memberentry.tt | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >index f96165ddde..d383c95e66 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt >@@ -136,7 +136,7 @@ > <div class="alert alert-error"><li> > <p>There were problems processing your registration. Please contact your library for help.</p> > [% IF error_type == 'Koha::Exceptions::Patron::InvalidUserid' %] >- <p>Error: Userid is not valid</p> >+ <p>Error: Username already exists or could not create unique new one.</p> > [% ELSE %] > <p>Error [% error_type | html %]: [% error_info | html %]</p> > [% END %] >@@ -212,7 +212,7 @@ > <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form" autocomplete="off"> > [% INCLUDE 'csrf-token.inc' %] > >- [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'middle_name' 'dateofbirth' 'initials' 'pronouns' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_streetnumber' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' 'lang' ] %] >+ [% FOREACH field = ['streetnumber' 'streettype' 'cardnumber' 'branchcode' 'categorycode' 'title' 'surname' 'firstname' 'middle_name' 'dateofbirth' 'initials' 'pronouns' 'othernames' 'address' 'address2' 'city' 'state' 'zipcode' 'country' 'phone' 'phonepro' 'mobile' 'email' 'emailpro' 'fax' 'B_streettype' 'B_streetnumber' 'B_address' 'B_address2' 'B_city' 'B_state' 'B_zipcode' 'B_country' 'B_phone' 'B_email' 'contactnote' 'altcontactsurname' 'altcontactfirstname' 'altcontactaddress1' 'altcontactaddress2' 'altcontactaddress3' 'altcontactstate' 'altcontactzipcode' 'altcontactcountry' 'altcontactphone' 'password' 'lang' 'userid'] %] > [% IF mandatory.defined( field ) %] > [% SET required.$field = 'required' %] > [% END %] >@@ -255,13 +255,13 @@ > </li> > [% END %] > >- [% IF op != 'new' %] >- [% UNLESS hidden.defined('userid') %] >- <li> >- <label>Username:</label> >- [% borrower.userid | html %] >- </li> >- [% END %] >+ [% UNLESS hidden.defined('userid') %] >+ <li> >+ <label for="borrower_userid" class="[% required.userid | html %]">Username:</label> >+ <input type="text" id="borrower_userid" name="borrower_userid" size="20" value="[% borrower.userid | html %]" class="[% required.userid | html %]"/> >+ <input type="text" disabled="disabled" style="display:none" /> >+ <div class="required_label [% required.userid | html %]">Required</div> >+ </li> > [% END %] > > [% UNLESS hidden.defined('dateexpiry') %] >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36430
:
170075
| 171981