@@ -, +, @@ --- 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(-) --- a/about.pl +++ a/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') --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt @@ -183,7 +183,7 @@
- [% 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) %]

Warning regarding current user

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.

@@ -228,7 +228,7 @@
[% 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 %]

Warnings regarding the system configuration

@@ -295,6 +295,11 @@ [% END %] [% END %] + [% IF oauth2_missing_deps %] + + [% END %]
Preferences and parameters
Warning + System preference 'RESTOAuth2ClientCredentials' is set, but the required Net::OAuth2::AuthorizationServer dependency is missing. The feature is disabled. +
[% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref +++ a/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 --