Bugzilla – Attachment 174093 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), 9.78 KB, created by
Martin Renvoize (ashimema)
on 2024-11-06 17:25:52 UTC
(
hide
)
Description:
Bug 37711: Domains CRUD update
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-11-06 17:25:52 UTC
Size:
9.78 KB
patch
obsolete
>From 1436dea179011582f7d08ea9752214551e90509d 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 | 29 ++++++----- > .../admin/identity_provider_domains.tt | 51 +++++++++++++++---- > 2 files changed, 59 insertions(+), 21 deletions(-) > >diff --git a/admin/identity_providers.pl b/admin/identity_providers.pl >index 74416f6aa73..1b3993600a9 100755 >--- a/admin/identity_providers.pl >+++ b/admin/identity_providers.pl >@@ -63,7 +63,8 @@ if ( !$domain_ops && $op eq 'cud-add' ) { > # 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 $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'); >@@ -84,10 +85,12 @@ if ( !$domain_ops && $op eq 'cud-add' ) { > )->store; > > Koha::Auth::Identity::Provider::Domain->new( >- { identity_provider_id => $provider->identity_provider_id, >+ { >+ 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, >@@ -118,7 +121,8 @@ elsif ( $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'); >@@ -128,14 +132,15 @@ elsif ( $domain_ops && $op eq 'cud-add' ) { > > Koha::Auth::Identity::Provider::Domain->new( > { >- allow_opac => $allow_opac, >- allow_staff => $allow_staff, >- identity_provider_id => $identity_provider_id, >- auto_register => $auto_register, >- default_category_id => $default_category_id, >- default_library_id => $default_library_id, >- domain => $domain, >- update_on_auth => $update_on_auth, >+ allow_opac => $allow_opac, >+ allow_staff => $allow_staff, >+ identity_provider_id => $identity_provider_id, >+ 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, >+ update_on_auth => $update_on_auth, > } > )->store; > >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 7f2cf0a5c00..2f0cca81c0e 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 >@@ -113,12 +113,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> >@@ -201,9 +209,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 %] >@@ -211,7 +232,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> >@@ -285,7 +306,8 @@ > <tr> > <th>Domain</th> > <th>Update on login</th> >- <th>Auto register</th> >+ <th>Auto register (OPAC)</th> >+ <th>Auto register (Staff)</th> > <th>Default library</th> > <th>Default category</th> > <th>Allow OPAC</th> >@@ -393,7 +415,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.47.0
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