@@ -, +, @@ - This patch fixes compilation errors due to previous patches - It also fixes syspref edition that was broken when CAS authentication was enabled. *But* this may break CAS-Proxy authentication. It needs to be tested. --- C4/Auth.pm | 15 ++++++++++++--- C4/Auth_with_cas.pm | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) --- a/C4/Auth.pm +++ a/C4/Auth.pm @@ -556,8 +556,16 @@ sub _version_check ($$) { # and so we must redirect to OPAC maintenance page or to the WebInstaller # also, if OpacMaintenance is ON, OPAC should redirect to maintenance if (C4::Context->preference('OpacMaintenance') && $type eq 'opac') { - warn "OPAC Install required, redirecting to maintenance"; - print $query->redirect("/cgi-bin/koha/maintenance.pl"); + warn "OPAC Install required, redirecting to maintenance"; + print $query->redirect("/cgi-bin/koha/maintenance.pl"); + } + unless ($version = C4::Context->preference('Version')) { # + + if ($type ne 'opac') { + warn "Install required, redirecting to Installer"; + print $query->redirect("/cgi-bin/koha/installer/install.pl"); + } + else { } exit; } @@ -1065,7 +1073,7 @@ sub check_api_auth { unless ($query->param('userid')) { $sessionID = $query->cookie("CGISESSID"); } - if ($sessionID && not $cas) { + if ($sessionID) { my $session = get_session($sessionID); C4::Context->_new_userenv($sessionID); if ($session) { @@ -1230,6 +1238,7 @@ sub check_api_auth { ); return ("ok", $cookie, $sessionID); } else { + return ("failed", undef, undef); } } --- a/C4/Auth_with_cas.pm +++ a/C4/Auth_with_cas.pm @@ -26,6 +26,7 @@ use C4::Utils qw( :all ); use Authen::CAS::Client; use CGI; use FindBin; +use YAML; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug); --