Bugzilla – Attachment 185341 Details for
Bug 37715
It should be possible to enable/disable each authentication method on the OPAC and staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Added OpacEnableLocalLogin/StaffEnableLocalLogin to disable local logins
37715.patch (text/plain), 10.19 KB, created by
Oliver Behnke
on 2025-08-12 16:07:46 UTC
(
hide
)
Description:
Added OpacEnableLocalLogin/StaffEnableLocalLogin to disable local logins
Filename:
MIME Type:
Creator:
Oliver Behnke
Created:
2025-08-12 16:07:46 UTC
Size:
10.19 KB
patch
obsolete
>diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 7ebb5b5699..83fe8fb4f9 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -479,6 +479,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACDetailQRCode','0','','Enable the display of a QR Code on the OPAC detail page','YesNo'), > ('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), > ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), >+('OpacEnableLocalLogin','1','','If ON enables local login for the OPAC','YesNo'), > ('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd','','Define export options available on OPAC detail page.','multiple'), > ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), > ('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'), >@@ -738,6 +739,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('SpineLabelFormat','<itemcallnumber><copynumber>','30|10','This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.','Textarea'), > ('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print label\" link will appear for each item on the bib details page in the staff interface.','YesNo'), > ('staffClientBaseURL','',NULL,'Specify the base URL of the staff interface starting with http:// or https://. Do not include a trailing slash in the URL. (This must be filled in correctly for CAS, svc, and load_testing to work.)','free'), >+('StaffEnableLocalLogin','1','','If ON enables local login for the staff interface','YesNo'), > ('StaffHighlightedWords','1','','Highlight search terms on staff interface','YesNo'), > ('StaffLangSelectorMode','footer','top|both|footer','Select the location to display the language selector in staff interface','Choice'), > ('StaffLoginInstructions', '', NULL, 'HTML to go into the login box for the staff interface','Free'), >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 d463b690e1..deab211c7c 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 >@@ -990,6 +990,12 @@ OPAC: > - "fields (separate values with |). Tabs appear in the order listed.<br/>" > - "<em>Currently supported values</em>: Item types (<strong>itemtypes</strong>), Collection, (<strong>ccode</strong>) and Shelving location (<strong>loc</strong>)." > Authentication: >+ - >+ - pref: OpacEnableLocalLogin >+ choices: >+ 1: Allow >+ 0: "Don't allow" >+ - patrons to log in using local user/password. > - > - pref: OPACShibOnly > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >index c8f3f5e1e7..283fe5e6e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref >@@ -191,6 +191,12 @@ Staff interface: > 0: "Don't show" > - a search field pulldown for 'Search the catalog' boxes. > Authentication: >+ - >+ - pref: StaffEnableLocalLogin >+ choices: >+ 1: Allow >+ 0: "Don't allow" >+ - staff to log in using local user/password. > - > - pref: staffShibOnly > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index ec76759dd3..d8d94dbb99 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -120,10 +120,13 @@ > </a> > </p> > [% END %] >+ [% IF Koha.Preference('StaffEnableLocalLogin') %] > <hr/> > <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END %] > [% END # /IF identity_providers.size %] > >+ [% IF Koha.Preference('StaffEnableLocalLogin') %] > <form action="[% script_name | html %]" method="post" name="loginform" id="loginform" class="validated"> > [% INCLUDE 'csrf-token.inc' %] > <input type="hidden" name="op" value="cud-login" /> >@@ -193,6 +196,7 @@ > > <p class="submit"><input id="submit-button" type="submit" class="btn btn-primary" value="Log in" tabindex="4" /></p> > </form> >+ [% END %] > > [% IF ( casAuthentication ) %] > <h4>CAS login</h4> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index cda06d56eb..5ffb0629f7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -426,9 +426,12 @@ > </a> > </p> > [% END %] >+ [% IF Koha.Preference('OpacEnableLocalLogin') %] > <hr/> > <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END %] > [% END # /IF identity_providers.size %] >+ [% IF Koha.Preference('OpacEnableLocalLogin') %] > <input type="hidden" name="koha_login_context" value="opac" /> > <fieldset class="brief"> > <div class="local-login"> >@@ -456,6 +459,7 @@ > [% END %] > </fieldset> > [% END %] >+ [% END %] > </div> > </form> <!-- /#auth --> > </div> <!-- /.modal-content --> >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 d2fe338e54..3425228f4b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -174,8 +174,10 @@ > </a> > </p> > [% END %] >+ [% IF Koha.Preference('OpacEnableLocalLogin') %] > <hr/> > <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END %] > [% END # /IF identity_providers %] > > [% IF ( Koha.Preference('GoogleOpenIDConnect') == 1 ) %] >@@ -209,7 +211,7 @@ > [% ELSE %] > <p>You must contact the library to reset your password</p> > [% END %] >- [% ELSIF !Koha.Preference('OPACShibOnly') or SCO_login or SCI_login %] >+ [% ELSIF (!Koha.Preference('OpacEnableLocalLogin') and !Koha.Preference('OPACShibOnly')) or SCO_login or SCI_login %] > [% IF SCO_login %] > <form action="/cgi-bin/koha/sco/sco-main.pl" name="auth" id="auth" method="post" autocomplete="off"> > [% ELSIF SCI_login %] >@@ -265,7 +267,7 @@ > </div> > [% END %] > </form> >- [% END # / IF password_has_expired / ELSIF !OPACShibOnly or SCO_login or SCI_login %] >+ [% END # / IF password_has_expired / ELSIF (!OpacEnableLocalLogin and !OPACShibOnly) or SCO_login or SCI_login %] > [% END # / IF loginprompt %] > > [% ELSE %] >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 75182f9149..560f483b2f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -195,9 +195,12 @@ > </a> > </p> > [% END %] >+ [% IF Koha.Preference('OpacEnableLocalLogin') %] > <hr/> > <p>If you do not have an external account, but do have a local account, you can still log in: </p> >+ [% END %] > [% END # /IF identity_providers.size %] >+ [% IF Koha.Preference('OpacEnableLocalLogin') %] > <div class="local-login"> > <label for="userid">Login:</label> > <input class="form-control" type="text" id="userid" name="login_userid" autocomplete="off" /> >@@ -223,6 +226,7 @@ > <p><a href="/cgi-bin/koha/opac-memberentry.pl">Create an account</a></p> > </div> > [% END %] >+ [% END %] > </fieldset> > </form> > </div> <!-- /#login -->
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 37715
: 185341