David Cook
e2e61ec6ca
This patch adds a enable_plugin_browser_upload flag to koha-conf.xml, which controls whether or not Koha intranet users can upload Koha plugins via their browser. Like "enable_plugins", it defaults to 0 for new installs. This is useful when you want to provide Koha intranet users with plugins that are pre-installed by administrators (by CLI) or restricting them to plugins from a Github repo. See the following for more information: Bug 23975 - Add ability to search and install plugins from GitHub Bug 23191 - Administrators should be able to install plugins from the command line To test: 1) Apply the full patchset 2) Confirm <enable_plugins>1</enable_plugins> is present in koha-conf.xml 3) Add <plugins_restricted>1</plugins_restricted> to koha-conf.xml 4) Ensure that the <plugin_repos> block is not commented and contains at least one trusted organisation in koha-conf.xml If needed get it from: debian/templates/koha-conf-site.xml.in 5) Run restart_all (in koha-testing-docker) 6) Go to /cgi-bin/koha/plugins/plugins-home.pl and note that you don't see an option to upload plugins 7) You should however see a search option and upon search you should have results returned from the chosen trusted organisations listed in the <plugin_repos> block mentioned above. 8) Clicking install on one of the results should work as expected and install the plugin. 9) Go directly to /cgi-bin/koha/plugins/plugins-upload.pl and note that it says "Plugin upload is restricted to only those plugins listed by your server administrator" and gives instructions on how to enable unrestricted browser upload. Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Cook <dcook@prosentient.com.au> Rebased-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
42 lines
1.5 KiB
Text
42 lines
1.5 KiB
Text
[% USE raw %]
|
|
[% PROCESS 'i18n.inc' %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>[% FILTER collapse %]
|
|
[% t("Plugins disabled") | html %] ›
|
|
[% t("Plugins") | html %] ›
|
|
[% t("Koha") | html %]
|
|
[% END %]</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% INCLUDE 'calendar.inc' %]
|
|
</head>
|
|
|
|
<body id="plugins_plugins_disabled" class="plugins">
|
|
[% WRAPPER 'header.inc' %]
|
|
[% INCLUDE 'circ-search.inc' %]
|
|
[% END %]
|
|
|
|
[% WRAPPER 'sub-header.inc' %]
|
|
[% WRAPPER breadcrumbs %]
|
|
[% WRAPPER breadcrumb_item %]
|
|
<a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
|
|
[% END %]
|
|
[% WRAPPER breadcrumb_item bc_active= 1 %]
|
|
<span>Plugins disabled</span>
|
|
[% END %]
|
|
[% END #/ WRAPPER breadcrumbs %]
|
|
[% END #/ WRAPPER sub-header.inc %]
|
|
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-sm-6 col-sm-offset-3 col-md-6 col-md-offset-3">
|
|
[% IF ( browser_upload_enabled.defined ) && ( browser_upload_enabled == 0 ) %]
|
|
<h1>Plugin browser upload disabled</h1>
|
|
<p>To enable Koha plugin browser upload, the flag enable_plugin_browser_upload must be set in the Koha configuration file</p>
|
|
[% ELSE %]
|
|
<h1>Plugins disabled</h1>
|
|
<p>To enable Koha plugins, the flag enable_plugins must be set in the Koha configuration file</p>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|