From ed1539eef5aae9c9e8ccffc3ed982c6d95d8be96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20DEMIANS?= Date: Sat, 6 Oct 2007 00:23:44 -0500 Subject: [PATCH] Bug #1462 correction. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Auth.pm | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) mode change 100644 => 100755 C4/Auth.pm diff --git a/C4/Auth.pm b/C4/Auth.pm old mode 100644 new mode 100755 index c04b6465c7..fbf4417895 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -375,6 +375,23 @@ sub checkauth { my $timeout = C4::Context->preference('timeout'); $timeout = 600 unless $timeout; + + # If Version syspref is unavailable, it means Koha is beeing installed, + # and so we must redirect to OPAC maintenance page or to the WebInstaller + warn "about to check version"; + unless (C4::Context->preference('Version')) { + if ($type ne 'opac') { + warn "Install required, redirecting to Installer"; + print $query->redirect("/cgi-bin/koha/installer/install.pl"); + } + else { + warn "OPAC Install required, redirecting to maintenance"; + print $query->redirect("/cgi-bin/koha/maintenance.pl"); + } + exit; + } + + # state variables my $loggedin = 0; my %info; @@ -645,17 +662,6 @@ sub checkauth { # check that database and koha version are the same # there is no DB version, it's a fresh install, # go to web installer - warn "about to check version"; - unless (C4::Context->preference('Version')){ - if ($type ne 'opac'){ - warn "Install required, redirecting to Installer"; - print $query->redirect("/cgi-bin/koha/installer/install.pl"); - } else { - warn "OPAC Install required, redirecting to maintenance"; - print $query->redirect("/cgi-bin/koha/maintenance.pl"); - } - exit; - } # there is a DB version, compare it to the code version my $kohaversion=C4::Context::KOHAVERSION; # remove the 3 last . to have a Perl number -- 2.39.5