Revision 4344f4e3
Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
12 | 12 |
use SL::Auth::DB; |
13 | 13 |
use SL::Auth::LDAP; |
14 | 14 |
|
15 |
use SL::SessionFile; |
|
15 | 16 |
use SL::User; |
16 | 17 |
use SL::DBConnect; |
17 | 18 |
use SL::DBUpgrade2; |
... | ... | |
555 | 556 |
|
556 | 557 |
$dbh->commit(); |
557 | 558 |
|
559 |
SL::SessionFile->destroy_session($session_id); |
|
560 |
|
|
558 | 561 |
$session_id = undef; |
559 | 562 |
$self->{SESSION} = { }; |
560 | 563 |
} |
... | ... | |
571 | 574 |
|
572 | 575 |
my $dbh = $self->dbconnect(); |
573 | 576 |
|
574 |
$dbh->begin_work; |
|
577 |
my $query = qq|SELECT id |
|
578 |
FROM auth.session |
|
579 |
WHERE (mtime < (now() - '$self->{session_timeout}m'::interval))|; |
|
575 | 580 |
|
576 |
my $query = |
|
577 |
qq|DELETE FROM auth.session_content |
|
578 |
WHERE session_id IN |
|
579 |
(SELECT id |
|
580 |
FROM auth.session |
|
581 |
WHERE (mtime < (now() - '$self->{session_timeout}m'::interval)))|; |
|
581 |
my @ids = selectall_array_query($::form, $dbh, $query); |
|
582 | 582 |
|
583 |
do_query($main::form, $dbh, $query); |
|
583 |
if (@ids) { |
|
584 |
$dbh->begin_work; |
|
584 | 585 |
|
585 |
$query = |
|
586 |
qq|DELETE FROM auth.session |
|
587 |
WHERE (mtime < (now() - '$self->{session_timeout}m'::interval))|; |
|
586 |
SL::SessionFile->destroy_session($_) for @ids; |
|
588 | 587 |
|
589 |
do_query($main::form, $dbh, $query); |
|
588 |
$query = qq|DELETE FROM auth.session_content |
|
589 |
WHERE session_id IN (| . join(', ', ('?') x scalar(@ids)) . qq|)|; |
|
590 |
do_query($main::form, $dbh, $query, @ids); |
|
590 | 591 |
|
591 |
$dbh->commit(); |
|
592 |
$query = qq|DELETE FROM auth.session |
|
593 |
WHERE id IN (| . join(', ', ('?') x scalar(@ids)) . qq|)|; |
|
594 |
do_query($main::form, $dbh, $query, @ids); |
|
595 |
|
|
596 |
$dbh->commit(); |
|
597 |
} |
|
592 | 598 |
|
593 | 599 |
$main::lxdebug->leave_sub(); |
594 | 600 |
} |
Auch abrufbar als: Unified diff
Session-basierte Dateien (die also bei Ablauf gelöscht werden)
Conflicts: