use C4::Debug;
use C4::Context;
-die("Koha plugins are disabled!")
- unless C4::Context->preference('UseKohaPlugins');
+my $plugins_enabled = C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins");
my $cgi = new CGI;
my $method = $cgi->param('method');
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
- { template_name => "plugins/plugins-home.tmpl",
+ { template_name => "plugins/plugins-disabled.tmpl",
query => $cgi,
type => "intranet",
authnotrequired => 0,
}
);
-my $plugin = Koha::Plugins::Handler->run( { class => $class, method => $method, cgi => $cgi } );
+if ( $plugins_enabled ) {
+ my $plugin = Koha::Plugins::Handler->run( { class => $class, method => $method, cgi => $cgi } );
+} else {
+ output_html_with_http_headers( $cgi, $cookie, $template->output );
+}