Lines 25-31
use IO::File;
Link Here
|
25 |
use CGI qw ( -utf8 ); |
25 |
use CGI qw ( -utf8 ); |
26 |
use CGI::Session; |
26 |
use CGI::Session; |
27 |
use C4::Context; |
27 |
use C4::Context; |
28 |
use C4::Auth qw/check_cookie_auth/; |
28 |
use C4::Auth qw/check_cookie_auth haspermission/; |
29 |
use CGI::Cookie; # need to check cookies before |
29 |
use CGI::Cookie; # need to check cookies before |
30 |
# having CGI parse the POST request |
30 |
# having CGI parse the POST request |
31 |
use C4::UploadedFile; |
31 |
use C4::UploadedFile; |
Lines 38-46
use C4::UploadedFile;
Link Here
|
38 |
# requires that the session cookie already |
38 |
# requires that the session cookie already |
39 |
# have been created. |
39 |
# have been created. |
40 |
|
40 |
|
|
|
41 |
my $flags_required = [ |
42 |
{circulate => 'circulate_remaining_permissions'}, |
43 |
{tools => 'stage_marc_import'}, |
44 |
{tools => 'upload_local_cover_images'} |
45 |
]; |
46 |
|
41 |
my %cookies = fetch CGI::Cookie; |
47 |
my %cookies = fetch CGI::Cookie; |
42 |
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { tools => '*' }); |
48 |
|
43 |
if ($auth_status ne "ok") { |
49 |
my $auth_failure = 1; |
|
|
50 |
my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value); |
51 |
foreach my $flag_required (@{ $flags_required}) { |
52 |
if (my $flags = haspermission(C4::Context->config('user'), $flag_required)) { |
53 |
$auth_failure = 0 if $auth_status eq 'ok'; |
54 |
} |
55 |
} |
56 |
|
57 |
if ($auth_failure) { |
44 |
$auth_status = 'denied' if $auth_status eq 'failed'; |
58 |
$auth_status = 'denied' if $auth_status eq 'failed'; |
45 |
send_reply($auth_status, ""); |
59 |
send_reply($auth_status, ""); |
46 |
exit 0; |
60 |
exit 0; |
47 |
- |
|
|