From: Moritz Bunkus Date: Mon, 28 Feb 2011 08:00:48 +0000 (+0100) Subject: Session immer am Ende des Requests speichern X-Git-Tag: release-2.6.3~66 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=57cf17b9ed978aad1931b6f9e2c4c86b635d9d27;p=kivitendo-erp.git Session immer am Ende des Requests speichern Momentan wird eh am Anfang der Session einmal gespeichert, wenn Benutzername und Passwort überprüft wurden. Somit erspart man sich späteres Speichern. --- 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 {