Bug 29931: Check cookie status before continuing
Test plan: Logout from staff. Try to run plugins-enable (you should have some active plugin). Like: https://yourserver:staffport/cgi-bin/koha/plugins/plugins-enable.pl?class=Koha::Plugin::Test&method=enable Replace class and method as appropriate. Verify that with this patch, you will be redirected to 401 page. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
e309da639f
commit
244e798a51
1 changed files with 5 additions and 2 deletions
|
@ -27,8 +27,11 @@ die("Koha plugins are disabled!") unless C4::Context->config("enable_plugins");
|
|||
|
||||
my $input = CGI->new;
|
||||
|
||||
my ( $auth_status ) =
|
||||
check_cookie_auth( $input->cookie('CGISESSID'), { plugins => 'manage' } );
|
||||
my ( $auth_status ) = check_cookie_auth( $input->cookie('CGISESSID'), { plugins => 'manage' } );
|
||||
if( $auth_status ne 'ok' ) {
|
||||
print CGI::header( '-status' => '401' );
|
||||
exit 0;
|
||||
}
|
||||
|
||||
my $class = $input->param('class');
|
||||
my $method = $input->param('method');
|
||||
|
|
Loading…
Reference in a new issue