Bugzilla – Attachment 75207 Details for
Bug 20734
Add warning to the about page if RESTOAuth2ClientCredentials and not Net::OAuth2::AuthorizationServer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20734: Add warning to the about page if RESTOAuth2ClientCredentials and not Net::OAuth2::AuthorizationServer
Bug-20734-Add-warning-to-the-about-page-if-RESTOAu.patch (text/plain), 5.02 KB, created by
Tomás Cohen Arazi (tcohen)
on 2018-05-09 15:10:07 UTC
(
hide
)
Description:
Bug 20734: Add warning to the about page if RESTOAuth2ClientCredentials and not Net::OAuth2::AuthorizationServer
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2018-05-09 15:10:07 UTC
Size:
5.02 KB
patch
obsolete
>From 4e99feac4ff4b08ebaee86737460ed8cf3b0ab28 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 9 May 2018 11:31:34 -0300 >Subject: [PATCH] Bug 20734: Add warning to the about page if > RESTOAuth2ClientCredentials and not Net::OAuth2::AuthorizationServer > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > about.pl | 8 ++++++++ > koha-tmpl/intranet-tmpl/prog/en/modules/about.tt | 9 +++++++-- > .../prog/en/modules/admin/preferences/web_services.pref | 2 +- > 3 files changed, 16 insertions(+), 3 deletions(-) > >diff --git a/about.pl b/about.pl >index 3997d4992a..b3cad66325 100755 >--- a/about.pl >+++ b/about.pl >@@ -26,6 +26,7 @@ use CGI qw ( -utf8 ); > use DateTime::TimeZone; > use List::MoreUtils qw/ any /; > use LWP::Simple; >+use Module::Load::Conditional qw(can_load); > use XML::Simple; > use Config; > use Search::Elasticsearch; >@@ -391,6 +392,13 @@ if ( C4::Context->preference('SearchEngine') eq 'Elasticsearch' ) { > } > } > >+if ( C4::Context->preference('RESTOAuth2ClientCredentials') ) { >+ # Do we have the required deps? >+ unless ( can_load( modules => { 'Net::OAuth2::AuthorizationServer' => undef }) ) { >+ $template->param( oauth2_missing_deps => 1 ); >+ } >+} >+ > # Sco Patron should not contain any other perms than circulate => self_checkout > if ( C4::Context->preference('WebBasedSelfCheck') > and C4::Context->preference('AutoSelfCheckAllowed') >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >index c35a01ef87..abcd8c3587 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt >@@ -183,7 +183,7 @@ > </div> > > <div id="sysinfo"> >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || warnIsRootUser || xml_config_warnings.size || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || has_ai_issues || oauth2_missing_deps %] > [% IF (warnIsRootUser) %] > <h2>Warning regarding current user</h2> > <p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p> >@@ -228,7 +228,7 @@ > <br/> > [% END %] > >- [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration %] >+ [% IF warnPrefBiblioAddsAuthorities || warnPrefEasyAnalyticalRecords || warnPrefAnonymousPatron || warnPrefAnonymousPatron_PatronDoesNotExist || warnNoActiveCurrency || QueryParserError || AutoSelfCheckPatronDoesNotHaveSelfCheckPerm || AutoSelfCheckPatronHasTooManyPerm || warnStatisticsFieldsError || warnNoTemplateCaching || warnILLConfiguration || oauth2_missing_deps %] > <h2>Warnings regarding the system configuration</h2> > <table> > <caption>Preferences and parameters</caption> >@@ -295,6 +295,11 @@ > </td></tr> > [% END %] > [% END %] >+ [% IF oauth2_missing_deps %] >+ <tr><th scope="row"><b>Warning</b> </th><td> >+ System preference 'RESTOAuth2ClientCredentials' is set, but the required Net::OAuth2::AuthorizationServer dependency is missing. The feature is disabled. >+ </td></tr> >+ [% END %] > </table> > [% END %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >index d9ad25fb52..6b415f212c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref >@@ -10,7 +10,7 @@ Web services: > choices: > yes: Enable > no: "Disable" >- - "the OAuth2 client credentials grant for the REST API." >+ - "the OAuth2 client credentials grant for the REST API. Requires Net::OAuth2::AuthorizationServer installed. [EXPERIMENTAL]" > OAI-PMH: > - > - pref: OAI-PMH >-- >2.17.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 20734
:
75207
|
75208