Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 08d78ff5

Von Sven Schöling vor mehr als 11 Jahren hinzugefügt

  • ID 08d78ff5c14d302d3e86d368d752195625c3120d
  • Vorgänger 19bc00f2
  • Nachfolger aba17eb1

SessionFile optional mit session_id laden

(wird für background_jobs benötigt

Unterschiede anzeigen:

SL/SessionFile.pm
13 13
use Rose::Object::MakeMethods::Generic
14 14
(
15 15
 scalar => [ qw(fh file_name) ],
16
 'scalar --get_set_init' => [ qw(session_id) ],
16 17
);
17 18

  
18 19
sub new {
......
64 65
}
65 66

  
66 67
sub get_path {
67
  die "No session ID" unless $::auth->get_session_id;
68
  return "users/session_files/" . $::auth->get_session_id;
68
  die "No session ID" unless $_[0]->session_id;
69
  return "users/session_files/" . $_[0]->session_id;
69 70
}
70 71

  
71 72
sub prepare_path {
72
  my $path = get_path();
73
  my $path = $_[0]->get_path;
73 74
  return $path if -d $path;
74 75
  mkpath $path;
75 76
  die "Creating ${path} failed" unless -d $path;
76 77
  return $path;
77 78
}
78 79

  
80
sub init_session_id {
81
  $::auth->get_session_id;
82
}
83

  
79 84
sub destroy_session {
80 85
  my ($class, $session_id) = @_;
81 86

  

Auch abrufbar als: Unified diff