Lines 32-42
use C4::Debug;
Link Here
|
32 |
use Koha::Plugins; |
32 |
use Koha::Plugins; |
33 |
|
33 |
|
34 |
my $plugins_enabled = C4::Context->config("enable_plugins"); |
34 |
my $plugins_enabled = C4::Context->config("enable_plugins"); |
|
|
35 |
my $browser_upload_enabled = C4::Context->config('enable_plugin_browser_upload'); |
35 |
|
36 |
|
36 |
my $input = new CGI; |
37 |
my $input = new CGI; |
37 |
|
38 |
|
38 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
39 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
39 |
{ template_name => ($plugins_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt", |
40 |
{ template_name => ($plugins_enabled && $browser_upload_enabled) ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt", |
40 |
query => $input, |
41 |
query => $input, |
41 |
type => "intranet", |
42 |
type => "intranet", |
42 |
authnotrequired => 0, |
43 |
authnotrequired => 0, |
Lines 45-50
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
45 |
} |
46 |
} |
46 |
); |
47 |
); |
47 |
|
48 |
|
|
|
49 |
if ($plugins_enabled){ |
50 |
$template->param( browser_upload_enabled => $browser_upload_enabled ); |
51 |
} |
52 |
|
48 |
my $uploadfilename = $input->param('uploadfile'); |
53 |
my $uploadfilename = $input->param('uploadfile'); |
49 |
my $uploadfile = $input->upload('uploadfile'); |
54 |
my $uploadfile = $input->upload('uploadfile'); |
50 |
my $uploadlocation = $input->param('uploadlocation'); |
55 |
my $uploadlocation = $input->param('uploadlocation'); |
Lines 54-60
my ( $tempfile, $tfh );
Link Here
|
54 |
|
59 |
|
55 |
my %errors; |
60 |
my %errors; |
56 |
|
61 |
|
57 |
if ($plugins_enabled) { |
62 |
if ($plugins_enabled && $browser_upload_enabled) { |
58 |
if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) { |
63 |
if ( ( $op eq 'Upload' ) && ( $uploadfile || $uploadlocation ) ) { |
59 |
my $plugins_dir = C4::Context->config("pluginsdir"); |
64 |
my $plugins_dir = C4::Context->config("pluginsdir"); |
60 |
$plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir; |
65 |
$plugins_dir = ref($plugins_dir) eq 'ARRAY' ? $plugins_dir->[0] : $plugins_dir; |
61 |
- |
|
|