From 57cf17b9ed978aad1931b6f9e2c4c86b635d9d27 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 28 Feb 2011 09:00:48 +0100 Subject: [PATCH] Session immer am Ende des Requests speichern MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Momentan wird eh am Anfang der Session einmal gespeichert, wenn Benutzername und Passwort überprüft wurden. Somit erspart man sich späteres Speichern. --- SL/Auth.pm | 4 +++- SL/Dispatcher.pm | 3 ++- SL/Helper/Flash.pm | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/SL/Auth.pm b/SL/Auth.pm index e7f60e963..62686a635 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -611,7 +611,9 @@ sub save_session { my $self = shift; my $provided_dbh = shift; - my $dbh = $provided_dbh || $self->dbconnect(); + my $dbh = $provided_dbh || $self->dbconnect(1); + + return unless $dbh; $dbh->begin_work unless $provided_dbh; diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 55d238022..880f6f471 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -202,7 +202,7 @@ sub handle_request { $::auth->set_session_value('login', $::form->{login}, 'password', $::form->{password}); $::auth->create_or_refresh_session; - $::auth->delete_session_value('FLASH')->save_session(); + $::auth->delete_session_value('FLASH'); delete $::form->{password}; if ($action) { @@ -233,6 +233,7 @@ sub handle_request { $::form = undef; $::myconfig = (); Form::disconnect_standard_dbh; + $::auth->save_session; $::auth->dbdisconnect; $::lxdebug->end_request; diff --git a/SL/Helper/Flash.pm b/SL/Helper/Flash.pm index 8f68d00c7..876de9644 100644 --- a/SL/Helper/Flash.pm +++ b/SL/Helper/Flash.pm @@ -16,7 +16,7 @@ sub flash { } sub flash_later { - $::auth->set_session_value(FLASH => _store_flash($::auth->get_session_value('FLASH'), @_))->save_session(); + $::auth->set_session_value(FLASH => _store_flash($::auth->get_session_value('FLASH'), @_)); } sub render_flash { -- 2.20.1