Lines 1606-1612
sub check_api_auth {
Link Here
|
1606 |
($status, $sessionId) = check_api_auth($cookie, $userflags); |
1606 |
($status, $sessionId) = check_api_auth($cookie, $userflags); |
1607 |
|
1607 |
|
1608 |
Given a CGISESSID cookie set during a previous login to Koha, determine |
1608 |
Given a CGISESSID cookie set during a previous login to Koha, determine |
1609 |
if the user has the privileges specified by C<$userflags>. |
1609 |
if the user has the privileges specified by C<$userflags>. C<$userflags> |
|
|
1610 |
is passed unaltered into C<haspermission> and as such accepts all options |
1611 |
avaiable to that routine with the one caveat that C<check_api_auth> will |
1612 |
also allow 'undef' to be passed and in such a case the permissions check |
1613 |
will be skipped altogether. |
1610 |
|
1614 |
|
1611 |
C<check_cookie_auth> is meant for authenticating special services |
1615 |
C<check_cookie_auth> is meant for authenticating special services |
1612 |
such as tools/upload-file.pl that are invoked by other pages that |
1616 |
such as tools/upload-file.pl that are invoked by other pages that |
Lines 1701-1707
sub check_cookie_auth {
Link Here
|
1701 |
return ( "expired", undef ); |
1705 |
return ( "expired", undef ); |
1702 |
} else { |
1706 |
} else { |
1703 |
$session->param( 'lasttime', time() ); |
1707 |
$session->param( 'lasttime', time() ); |
1704 |
my $flags = haspermission( $userid, $flagsrequired ); |
1708 |
my $flags = defined($flagsrequired) ? haspermission( $userid, $flagsrequired ) : 1; |
1705 |
if ($flags) { |
1709 |
if ($flags) { |
1706 |
return ( "ok", $sessionID ); |
1710 |
return ( "ok", $sessionID ); |
1707 |
} else { |
1711 |
} else { |