From: Moritz Bunkus Date: Thu, 30 Dec 2010 14:24:40 +0000 (+0100) Subject: Speichern des Session-Inhaltes in eigene Funktion ausgelagert X-Git-Tag: release-2.6.2beta1~17^2~9^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2ecce44ce3c7488998dff5327c0aa8496a0e9b65;p=kivitendo-erp.git Speichern des Session-Inhaltes in eigene Funktion ausgelagert --- diff --git a/SL/Auth.pm b/SL/Auth.pm index 9b465ce65..7c9790462 100644 --- a/SL/Auth.pm +++ b/SL/Auth.pm @@ -604,17 +604,27 @@ sub create_or_refresh_session { } - $query = qq|INSERT INTO auth.session_content (session_id, sess_key, sess_value) VALUES (?, ?, ?)|; - $sth = prepare_query($form, $dbh, $query); + $self->save_session($dbh); + + $dbh->commit(); + + $main::lxdebug->leave_sub(); +} + +sub save_session { + my $self = shift; + my $provided_dbh = shift; + + my $dbh = $provided_dbh || $self->dbconnect(); + + my $query = qq|INSERT INTO auth.session_content (session_id, sess_key, sess_value) VALUES (?, ?, ?)|; + my $sth = prepare_query($::form, $dbh, $query); foreach my $key (sort keys %{ $self->{SESSION} }) { - do_statement($form, $sth, $query, $session_id, $key, $self->{SESSION}->{$key}); + do_statement($::form, $sth, $query, $session_id, $key, $self->{SESSION}->{$key}); } $sth->finish(); - $dbh->commit(); - - $main::lxdebug->leave_sub(); } sub set_session_value {