X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FSessionFile.pm;h=08f905bc8d81ca3863cadbf272b808f5bb7e7234;hb=7b195af14e0c5a01f86d7dccdd72a3b14ee52430;hp=6f04041e1a34bb56dd8cad7779d7fcfffb66a1f1;hpb=7b6a3af9cc51b982853b572028acc58c8349e2b6;p=kivitendo-erp.git diff --git a/SL/SessionFile.pm b/SL/SessionFile.pm index 6f04041e1..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) = @_; @@ -171,7 +176,7 @@ C<22.01.2011 14:12:22>. =item C Returns the name of the session-specific directory used for file -storage relative to the Lx-Office installation folder. +storage relative to the kivitendo installation folder. =item C