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