v20201024
authorKilian Saffran <ksaffran@dks.lu>
Mon, 26 Oct 2020 05:51:30 +0000 (06:51 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Mon, 26 Oct 2020 05:51:30 +0000 (06:51 +0100)
app/lib/dksdb.pm
app/lib/session.pm

index 9e9317d..60cf28b 100644 (file)
@@ -20,7 +20,7 @@ sub new {
     my $class = shift;
     my $p = shift;
     my $self = bless {}, $class;
-    $self->{debug} = 1;
+    $self->{debug} = 0;
     $self->{dbh} = DBI->connect($p->{dsn},$p->{dbuser},$p->{dbpassword},{PrintError=>1,RaiseError=>1,AutoCommit=>1})  or return "query Connection Error!".$!;
     return $self;
 }
index f947051..f2587f3 100644 (file)
@@ -209,16 +209,12 @@ sub getsession($){
   my $sql = "select se.id as idsession,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se 
 join users us on (us.id=se.id_user)
 left join usergroups ugrp on (ugrp.id=us.id_usergroup)
-where se.id= '".$self->{db}->securetext($sid)."' and se.remote_addr= '".$ENV{REMOTE_ADDR}."' and se.user_agent= '".$ENV{HTTP_USER_AGENT}."' and 
+where se.id= '".$self->{db}->securetext($sid)."' and se.remote_addr= '".$ENV{REMOTE_ADDR}."' and se.user_agent LIKE 'POT/%/%/%' and 
 us.isblocked is null group by se.id,us.id,ugrp.id;";
   my $res= $self->{db}->querysorted($sql);
-  #print STDERR "SESSION:\n".$sql."\n";
-  #print STDERR Dumper($res)."\n";
+  #print STDERR "AFTER  REQ:\n".$sql."\n";
+  #print STDERR "SESSIONDATA: ".Dumper($res)."\n";
   my $ret = undef;
-  # open FILE,">>tmp/sql.log";
-  # print FILE "GET DB Session\n";
-  # print FILE Dumper($res->{0});
-  # close(FILE);
   if (keys(%{$res}) > 0){
  
     return $res->{0};