View | Details | Raw Unified | Return to bug 25672
Collapse All | Expand All

(-)a/plugins/plugins-upload.pl (-5 / +9 lines)
Lines 35-58 my $plugins_enabled = C4::Context->config("enable_plugins"); Link Here
35
my $plugins_restricted = C4::Context->config("plugins_restricted");
35
my $plugins_restricted = C4::Context->config("plugins_restricted");
36
36
37
my $input = CGI->new;
37
my $input = CGI->new;
38
my $uploadlocation = $input->param('uploadlocation');
38
39
39
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
40
    {
41
    {
41
        template_name => $plugins_enabled ? "plugins/plugins-upload.tt" : "plugins/plugins-disabled.tt",
42
        template_name => ( !$plugins_enabled || $plugins_restricted && !$uploadlocation )
43
        ? 'plugins/plugins-disabled.tt'
44
        : 'plugins/plugins-upload.tt',
42
        query         => $input,
45
        query         => $input,
43
        type          => "intranet",
46
        type          => "intranet",
44
        flagsrequired => { plugins => 'manage' },
47
        flagsrequired => { plugins => 'manage' },
45
    }
48
    }
46
);
49
);
47
50
48
my $uploadlocation = $input->param('uploadlocation');
51
# Early exist if uploads are not enabled direct upload attempted when uploads are restricted
49
50
# Early exists if uploads are not enabled direct upload attempted when uploads are restricted
51
if (!$plugins_enabled) {
52
if (!$plugins_enabled) {
52
    output_html_with_http_headers $input, $cookie, $template->output;
53
    output_html_with_http_headers $input, $cookie, $template->output;
54
    exit;
53
} elsif ( $plugins_restricted && !$uploadlocation ) {
55
} elsif ( $plugins_restricted && !$uploadlocation ) {
54
    $template->param( plugins_restricted => $plugins_restricted );
56
    $template->param( plugins_restricted => $plugins_restricted );
55
    output_html_with_http_headers $input, $cookie, $template->output;
57
    output_html_with_http_headers $input, $cookie, $template->output;
58
    exit;
56
}
59
}
57
60
58
my $uploadfilename = $input->param('uploadfile');
61
my $uploadfilename = $input->param('uploadfile');
Lines 132-134 if ( ( $uploadfile || $uploadlocation ) && !%errors && !$template->param('ERRORS Link Here
132
} else {
135
} else {
133
    output_html_with_http_headers $input, $cookie, $template->output;
136
    output_html_with_http_headers $input, $cookie, $template->output;
134
}
137
}
135
- 
138
139
exit;

Return to bug 25672