Bugzilla – Attachment 185247 Details for
Bug 37711
IdP auto-register should work on the staff interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37711: Domains CRUD update
Bug-37711-Domains-CRUD-update.patch (text/plain), 11.10 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-08-07 20:44:59 UTC
(
hide
)
Description:
Bug 37711: Domains CRUD update
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-08-07 20:44:59 UTC
Size:
11.10 KB
patch
obsolete
>From cf4eaaca07b28bb7c4772867e352bcb2bf30f769 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 22 Aug 2024 15:50:16 -0300 >Subject: [PATCH] Bug 37711: Domains CRUD update > >This patch adapts the `Identity provider domains` CRUD page to handle >the new configuration options. > >To test: >1. Have an IdP with some domains set. Make sure there's at least one > domain with auto-register enabled and one with it disabled. >2. Apply this patches >3. Run: > $ ktd --shell > k$ updatedatabase >=> SUCCESS: Updates successfully >4. Run: > k$ yarn build >5. Refresh the IdP domains page >=> SUCCESS: The domains table shows both OPAC and staff auto-register > options. >=> SUCCESS: The staff auto-register is disabled for both domains >=> SUCCESS: The OPAC auto-register matches what was set for each domain >regarding auto-register (remember that before this patchset, >auto-register only works for the OPAC). >6. Play with editing/adding/removing domain configurations >=> SUCCESS: Things work as expected, values are persisted on the DB >correctly. >7. Sign off :-D > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > admin/identity_providers.pl | 16 ++-- > .../admin/identity_provider_domains.tt | 89 +++++++++++++------ > 2 files changed, 73 insertions(+), 32 deletions(-) > >diff --git a/admin/identity_providers.pl b/admin/identity_providers.pl >index ef71aaee86d..419d3a0c239 100755 >--- a/admin/identity_providers.pl >+++ b/admin/identity_providers.pl >@@ -63,9 +63,10 @@ if ( !$domain_ops && $op eq 'cud-add' ) { > my $protocol = $input->param('protocol'); > > # Domain configuration params >- my $allow_opac = $input->param('allow_opac') // 0; >- my $allow_staff = $input->param('allow_staff') // 0; >- my $auto_register = $input->param('auto_register') // 0; >+ my $allow_opac = $input->param('allow_opac') // 0; >+ my $allow_staff = $input->param('allow_staff') // 0; >+ my $auto_register_opac = $input->param('auto_register_opac') // 0; >+ my $auto_register_staff = $input->param('auto_register_staff') // 0; > my $default_category_id = $input->param('default_category_id'); > my $default_library_id = $input->param('default_library_id'); > my $domain = $input->param('domain'); >@@ -91,7 +92,8 @@ if ( !$domain_ops && $op eq 'cud-add' ) { > identity_provider_id => $provider->identity_provider_id, > allow_opac => $allow_opac, > allow_staff => $allow_staff, >- auto_register => $auto_register, >+ auto_register_opac => $auto_register_opac, >+ auto_register_staff => $auto_register_staff, > default_category_id => $default_category_id, > default_library_id => $default_library_id, > domain => $domain, >@@ -120,7 +122,8 @@ if ( !$domain_ops && $op eq 'cud-add' ) { > my $allow_opac = $input->param('allow_opac'); > my $allow_staff = $input->param('allow_staff'); > my $identity_provider_id = $input->param('identity_provider_id'); >- my $auto_register = $input->param('auto_register'); >+ my $auto_register_opac = $input->param('auto_register_opac'); >+ my $auto_register_staff = $input->param('auto_register_staff'); > my $default_category_id = $input->param('default_category_id') || undef; > my $default_library_id = $input->param('default_library_id') || undef; > my $domain = $input->param('domain'); >@@ -133,7 +136,8 @@ if ( !$domain_ops && $op eq 'cud-add' ) { > allow_opac => $allow_opac, > allow_staff => $allow_staff, > identity_provider_id => $identity_provider_id, >- auto_register => $auto_register, >+ auto_register_opac => $auto_register_opac, >+ auto_register_staff => $auto_register_staff, > default_category_id => $default_category_id, > default_library_id => $default_library_id, > domain => $domain, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt >index 84d64a37320..103d5b24eb7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/identity_provider_domains.tt >@@ -116,12 +116,20 @@ > <span>user data on login</span> > </li> > <li> >- <label for="auto_register">Auto register: </label> >- <select name="auto_register" id="auto_register"> >+ <label for="auto_register_opac">Auto register (OPAC): </label> >+ <select name="auto_register_opac" id="auto_register_opac"> > <option value="1">Allow</option> > <option value="0" selected="selected">Don't allow</option> > </select> >- <span>users to auto register on login</span> >+ <span>users to auto register on login (OPAC)</span> >+ </li> >+ <li> >+ <label for="auto_register_staff">Auto register (Staff interface): </label> >+ <select name="auto_register_staff" id="auto_register_staff"> >+ <option value="1">Allow</option> >+ <option value="0" selected="selected">Don't allow</option> >+ </select> >+ <span>users to auto register on login (Staff interface)</span> > </li> > <li> > <label for="default_library_id">Default library: </label> >@@ -205,9 +213,22 @@ > <span>user data on login</span> > </li> > <li> >- <label for="auto_register">Auto register: </label> >- <select name="auto_register" id="auto_register"> >- [% IF identity_provider_domain.auto_register == "1" %] >+ <label for="auto_register_opac">Auto register (OPAC): </label> >+ <select name="auto_register_opac" id="auto_register_opac"> >+ [% IF identity_provider_domain.auto_register_opac == "1" %] >+ <option value="1" selected="selected">Allow</option> >+ <option value="0">Don't allow</option> >+ [% ELSE %] >+ <option value="1">Allow</option> >+ <option value="0" selected="selected">Don't allow</option> >+ [% END %] >+ </select> >+ <span>users to auto register on OPAC login</span> >+ </li> >+ <li> >+ <label for="auto_register_staff">Auto register (Staff): </label> >+ <select name="auto_register_staff" id="auto_register_staff"> >+ [% IF identity_provider_domain.auto_register_staff == "1" %] > <option value="1" selected="selected">Allow</option> > <option value="0">Don't allow</option> > [% ELSE %] >@@ -215,7 +236,7 @@ > <option value="0" selected="selected">Don't allow</option> > [% END %] > </select> >- <span>users to auto register on login</span> >+ <span>users to auto register on staff interface login</span> > </li> > <li> > <label for="default_library_id">Default library: </label> >@@ -301,24 +322,29 @@ > </div> > [% END %] > >- <div id="delete_confirm_modal" class="modal" tabindex="-1" role="dialog" aria-labelledby="delete_confirm_modal_label" aria-hidden="true"> >- <div class="modal-dialog"> >- <div class="modal-content"> >- <div class="modal-header"> >- <h1 class="modal-title" id="delete_confirm_modal_label">Confirm deletion of identity provider domain</h1> >- <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> >- </div> >- <div class="modal-body"> >- <div id="delete_confirm_dialog"></div> >- </div> >- <div class="modal-footer"> >- <a href="#" class="btn btn-danger" id="delete_confirm_modal_button" role="button" data-bs-toggle="modal">Delete</a> >- <button type="button" class="btn btn-default" data-bs-dismiss="modal">Close</button> >- </div> >- </div> >- <!-- /.modal-content --> >- </div> >- <!-- /.modal-dialog --> >+ <div id="toolbar" class="btn-toolbar"> >+ <a class="btn btn-default" id="new_identity_provider_domain" href="/cgi-bin/koha/admin/identity_providers.pl?domain_ops=1&identity_provider_id=[%- identity_provider_id | html -%]&op=add_form" >+ ><i class="fa fa-plus"></i> New identity provider domain</a >+ > >+ </div> >+ >+ <h1>[% tx("Identity provider domains for '{identity_provider_code}'", {identity_provider_code = identity_provider_code}) | html %]</h1> >+ <div class="page-section"> >+ <table id="identity_provider_domains"> >+ <thead> >+ <tr> >+ <th>Domain</th> >+ <th>Update on login</th> >+ <th>Auto register (OPAC)</th> >+ <th>Auto register (Staff)</th> >+ <th>Default library</th> >+ <th>Default category</th> >+ <th>Allow OPAC</th> >+ <th>Allow staff</th> >+ <th data-class-name="actions noExport">Actions</th> >+ </tr> >+ </thead> >+ </table> > </div> > <!-- #delete_confirm_modal --> > [% END %] >@@ -390,7 +416,18 @@ > }, > { > "data": function( row, type, val, meta ) { >- if (row.auto_register) { >+ if (row.auto_register_opac) { >+ return _("Yes"); >+ } else { >+ return _("No"); >+ } >+ }, >+ "searchable": true, >+ "orderable": true >+ }, >+ { >+ "data": function( row, type, val, meta ) { >+ if (row.auto_register_staff) { > return _("Yes"); > } else { > return _("No"); >-- >2.50.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 37711
:
170643
|
170644
|
170645
|
170646
|
170647
|
174090
|
174091
|
174092
|
174093
|
174094
|
185244
|
185245
|
185246
| 185247 |
185248