Bugzilla – Attachment 178041 Details for
Bug 39135
adding a OpacPasswordLabelTextContent system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39135: adding a OpacPasswordLabelTextContent system preference
Bug-39135-adding-a-OpacPasswordLabelTextContent-sy.patch (text/plain), 10.88 KB, created by
Imani
on 2025-02-13 17:05:03 UTC
(
hide
)
Description:
Bug 39135: adding a OpacPasswordLabelTextContent system preference
Filename:
MIME Type:
Creator:
Imani
Created:
2025-02-13 17:05:03 UTC
Size:
10.88 KB
patch
obsolete
>From 4f6e8d39287a7a3b96f1d3f323e44826ee3bddd4 Mon Sep 17 00:00:00 2001 >From: Imani Thomas <imani.thomas@bywatersolutions.com> >Date: Thu, 13 Feb 2025 16:59:42 +0000 >Subject: [PATCH] Bug 39135: adding a OpacPasswordLabelTextContent system > preference > >add a new system preference for password labels > >to test: >1. apply the patch >2. log into admin and go to the opac system preferences and change the OpacPasswordLabelTextContent system preference to Password/PIN >3. go to the public url and open the login and see the password field now says Password/PIN instead >4. Change the preference again and save and see your changes reflected >--- > .../data/mysql/atomicupdate/bug_39135.pl | 21 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 1 + > .../en/modules/admin/preferences/opac.pref | 9 ++++++++ > .../bootstrap/en/includes/html_helpers.inc | 11 ++++++++++ > .../bootstrap/en/includes/masthead.inc | 8 +++++-- > .../bootstrap/en/modules/opac-auth.tt | 2 +- > .../bootstrap/en/modules/opac-main.tt | 2 +- > .../modules/opac-registration-confirmation.tt | 2 +- > .../bootstrap/en/modules/sco/sco-main.tt | 4 +--- > 9 files changed, 52 insertions(+), 8 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_39135.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_39135.pl b/installer/data/mysql/atomicupdate/bug_39135.pl >new file mode 100755 >index 0000000000..b60bd563ab >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_39135.pl >@@ -0,0 +1,21 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "39135", >+ description => "Add system preference to determine label of password input on login form", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ $dbh->do( >+ q{INSERT IGNORE INTO systempreferences (variable,value) VALUES ('OPACPasswordLabelTextContent','password') } >+ ); >+ >+ # Print useful stuff here >+ >+ # sysprefs >+ say $out "Added new system preference 'OPACPasswordLabelTextContent'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 682b9fb950..818d61761d 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -530,6 +530,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'), > ('OPACOverDrive','0',NULL,'Enable OverDrive integration in the OPAC','YesNo'), > ('OpacPasswordChange','1',NULL,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)','YesNo'), >+('OPACPasswordLabelTextContent','password',NULL,NULL,NULL), > ('OPACPatronDetails','1','','If OFF the patron details tab in the OPAC is disabled.','YesNo'), > ('OPACpatronimages','0',NULL,'Enable patron images in the OPAC','YesNo'), > ('OPACPlayMusicalInscripts','0','','If displayed musical inscripts, play midi conversion on the OPAC record details page.','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 03739d28f8..314277dd2c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -191,6 +191,15 @@ OPAC: > username: username > cardnumberorusername: card number or username > - "as the label of the userid input field on the OPAC login form." >+ - >+ - Use >+ - pref: OPACPasswordLabelTextContent >+ default: Password >+ choices: >+ password: Password >+ pin: PIN >+ passwordorpin: Password/PIN >+ - "as the label of the password input field on the OPAC login form." > - > - pref: OPACShowMusicalInscripts > default: 0 >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc >index 8f8cc44535..6c27eafbe3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/html_helpers.inc >@@ -184,3 +184,14 @@ > [%- END %] > <label for="[% for | html %]">[% label | html %]:</label> > [% END %] >+ >+[% BLOCK password_label %] >+ [%- SET preference_value = Koha.Preference('OPACPasswordLabelTextContent') %] >+ [%- SET label = t("Password") %] >+ [%- IF preference_value == "pin" %] >+ [%- SET label = t("PIN") %] >+ [%- ELSIF preference_value == "passwordorpin" %] >+ [%- SET label = t("Password/PIN") %] >+ [%- END %] >+ <label for="[% for | html %]">[% label | html %]:</label> >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index e624134bf5..3ddb993f07 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -495,8 +495,12 @@ > <input type="hidden" name="koha_login_context" value="opac" /> > <fieldset class="brief"> > <div class="local-login"> >- [% PROCESS login_label for="muserid" %]<input type="text" id="muserid" name="login_userid" autocomplete="off" /> <label for="mpassword">Password:</label >- ><input type="password" id="mpassword" name="login_password" autocomplete="off" /> >+ [% PROCESS login_label for="muserid" %]<input type="text" id="muserid" name="login_userid" autocomplete="off" /> [% PROCESS password_label for="mpassword" %]<input >+ type="password" >+ id="mpassword" >+ name="login_password" >+ autocomplete="off" >+ /> > <fieldset class="action"> > <input type="hidden" name="op" value="cud-login" /> > <input type="submit" class="btn btn-primary" value="Log in" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >index 5414b9e6ef..86e1e5ff80 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -251,7 +251,7 @@ > <input class="form-control" type="text" size="25" id="userid" name="login_userid" autocomplete="off" /> > </div> > <div class="form-group"> >- <label for="password">Password:</label> >+ [% PROCESS password_label for="password" %] > <input class="form-control" type="password" size="25" id="password" name="login_password" autocomplete="off" /> > </div> > <fieldset class="action"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 476bc3c323..3ef36ba6f0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -193,7 +193,7 @@ > <div class="local-login"> > [% PROCESS login_label for='userid' %] > <input class="form-control" type="text" id="userid" name="login_userid" autocomplete="off" /> >- <label for="password">Password:</label> >+ [% PROCESS password_label for="password" %] > <input class="form-control" type="password" id="password" name="login_password" autocomplete="off" /> > <fieldset class="action"> > <input type="hidden" name="op" value="cud-login" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >index b6a5fa090c..cd6957c648 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-registration-confirmation.tt >@@ -114,7 +114,7 @@ > [% ELSE %] > <input class="form-control" type="text" id="userid" size="10" name="login_userid" value="" autocomplete="off" /> > [% END %] >- <label for="password">Password:</label> >+ [% PROCESS password_label for="password" %] > [% IF Koha.Preference('PatronSelfRegistrationPrefillForm') %] > <input class="form-control" type="password" id="password" size="10" name="login_password" value="[% password_cleartext | html %]" autocomplete="off" /> > [% ELSE %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index e0e60ce148..82581c175f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -315,9 +315,7 @@ > <div class="col-md-12"> > <input type="text" id="patronlogin" class="form-control focus noEnterSubmit" size="20" name="patronlogin" autocomplete="off" /> > </div> >- <div class="col-md-12"> >- <label for="patronpw">Password:</label> >- </div> >+ <div class="col-md-12"> [% PROCESS password_label for="patronpw" %] </div> > <div class="col-md-12"> > <input type="password" id="patronpw" class="form-control" size="20" name="patronpw" autocomplete="off" /> > </div> >-- >2.39.5
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 39135
:
178040
| 178041