From b8e4963f90424ba3b495c5ca7e766788d016c760 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 26 Jul 2005 10:12:48 +0000 Subject: [PATCH] some bugfixes, but still don't work correctly --- C4/Auth.pm | 2 ++ C4/Context.pm | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index f30e66db12..d9588b5e25 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -294,6 +294,8 @@ sub checkauth { -expires => ''); $loggedin = 1; } elsif ($sessionID=$query->cookie('sessionID')) { + warn "NEWUSERENV : ".$sessionID; + C4::Context->_new_userenv($sessionID); my ($ip , $lasttime); ($userid, $ip, $lasttime) = $dbh->selectrow_array( "SELECT userid,ip,lasttime FROM sessions WHERE sessionid=?", diff --git a/C4/Context.pm b/C4/Context.pm index 9793da2a14..b8d6b5e7b3 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -232,6 +232,8 @@ sub new $self->{"dbh"} = undef; # Database handle $self->{"stopwords"} = undef; # stopwords list $self->{"marcfromkohafield"} = undef; # the hash with relations between koha table fields and MARC field/subfield + $self->{"userenv"} = undef; # User env + $self->{"context"} = undef; # current active user bless $self, $class; return $self; @@ -637,6 +639,7 @@ set_userenv is called in Auth.pm sub set_userenv { my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $userflags)= @_; + warn "SETTING : $usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $userflags"; $context->{$context->{"activeuser"}}=\{ "number" => $usernum, "id" => $userid, @@ -645,7 +648,7 @@ sub set_userenv "surname" => $usersurname, "branch" => $userbranch, "flags" => $userflags - } + }; } =item _new_userenv -- 2.39.5