From 08d78ff5c14d302d3e86d368d752195625c3120d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 15 Nov 2012 15:09:13 +0100 Subject: [PATCH] SessionFile optional mit session_id laden MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit (wird für background_jobs benötigt --- SL/SessionFile.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SL/SessionFile.pm b/SL/SessionFile.pm index f4c509c33..08f905bc8 100644 --- a/SL/SessionFile.pm +++ b/SL/SessionFile.pm @@ -13,6 +13,7 @@ use POSIX qw(strftime); use Rose::Object::MakeMethods::Generic ( scalar => [ qw(fh file_name) ], + 'scalar --get_set_init' => [ qw(session_id) ], ); sub new { @@ -64,18 +65,22 @@ sub displayable_mtime { } sub get_path { - die "No session ID" unless $::auth->get_session_id; - return "users/session_files/" . $::auth->get_session_id; + die "No session ID" unless $_[0]->session_id; + return "users/session_files/" . $_[0]->session_id; } sub prepare_path { - my $path = get_path(); + my $path = $_[0]->get_path; return $path if -d $path; mkpath $path; die "Creating ${path} failed" unless -d $path; return $path; } +sub init_session_id { + $::auth->get_session_id; +} + sub destroy_session { my ($class, $session_id) = @_; -- 2.20.1