From 0afb34457145b6c4cff85dcf449cc858a6ee55e8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 2 Sep 2015 17:13:41 +0100 Subject: [PATCH] Bug 10799: Limit the SCO user to the SCO module The SCO user should only be allowed to access to the SCO module. This patch make the session ends if the user tries to access another page after the SCO module. Test plan: 0/ Configure the SCO module correctly 1/ Go on the sco main page (sco/sco-main.pl) 2/ Try to go somewhere else: you should not be logged in --- C4/Auth.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/C4/Auth.pm b/C4/Auth.pm index ef0c585..f41f098 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -178,6 +178,13 @@ sub get_template_and_user { ); } + # If the user logged in is the SCO user and he tries to go out the SCO module, the log user out. + if ( $in->{type} eq 'opac' and $in->{template_name} !~ m|sco/| ) { + if ( $user eq C4::Context->preference('AutoSelfCheckID') ) { + $user = undef; + } + } + my $borrowernumber; if ($user) { require C4::Members; -- 2.1.0