Browse Source

Fixing a bug that occured if Koha wasnt installed, but a cookie was set in the browser

Signed-off-by: Chris Cormack <crc@liblime.com>
3.0.x
Chris Cormack 17 years ago
parent
commit
16d7cb2ea3
  1. 16
      C4/Auth.pm

16
C4/Auth.pm

@ -382,9 +382,15 @@ sub checkauth {
$session->param('emailaddress'), $session->param('branchprinter') $session->param('emailaddress'), $session->param('branchprinter')
); );
} }
my $ip=$session->param('ip'); my $ip;
my $lasttime;
if ($session) {
$ip = $session->param('ip');
$lasttime = $session->param('lasttime');
$userid = $session->param('id'); $userid = $session->param('id');
my $lasttime = $session->param('lasttime'); }
if ($logout) { if ($logout) {
# voluntary logout the user # voluntary logout the user
@ -443,7 +449,10 @@ sub checkauth {
} }
unless ($userid) { unless ($userid) {
my $session = new CGI::Session("driver:MySQL", undef, {Handle=>$dbh}); my $session = new CGI::Session("driver:MySQL", undef, {Handle=>$dbh});
my $sessionID = $session->id; my $sessionID;
if ($session) {
$sessionID = $session->id;
}
$userid = $query->param('userid'); $userid = $query->param('userid');
C4::Context->_new_userenv($sessionID); C4::Context->_new_userenv($sessionID);
my $password = $query->param('password'); my $password = $query->param('password');
@ -610,6 +619,7 @@ sub checkauth {
# check that database and koha version are the same # check that database and koha version are the same
# there is no DB version, it's a fresh install, # there is no DB version, it's a fresh install,
# go to web installer # go to web installer
warn "about to check version";
unless (C4::Context->preference('Version')){ unless (C4::Context->preference('Version')){
if ($type ne 'opac'){ if ($type ne 'opac'){
warn "Install required, redirecting to Installer"; warn "Install required, redirecting to Installer";

Loading…
Cancel
Save