Revision 255
- Date:
- 2012/09/26 17:28:00
- Files:
Legend:
- Added
- Removed
- Modified
-
koi8/plugins/session/lib/session/Keeper.pm
44 44 status => $res->status, 45 45 ltime => time, 46 46 ); 47 my ($type_prop) = grep { $_->{attr} eq 'type' } $res->structure; 48 $data{type} = $res->type if $type_prop; 47 49 $self->store_value ( %data ); 48 50 } 49 51 return $self->get_session(); … … 82 84 } 83 85 84 86 87 sub autologon { 88 my $self = shift; 89 my %opts = @_; 90 91 my $profile = delete $opts{profile}; 92 if ( ref $profile ) { 93 my %data = ( 94 id => $profile->id, 95 name => $profile->name, 96 email => $profile->email, 97 login => $profile->login, 98 status => $profile->status, 99 ltime => time, 100 ); 101 my ($type_prop) = grep { $_->{attr} eq 'type' } $profile->structure; 102 $data{type} = $profile->type if $type_prop; 103 my ($ava_prop) = grep { $_->{attr} eq 'avatar' } $profile->structure; 104 if ( $ava_prop ) { 105 my $avatar = $profile->get_image('avatar'); 106 $data{avatar} = $avatar->{mini}{filename} if ref $avatar && exists $avatar->{filename}; 107 } 108 $self->store_value ( %data ); 109 return $self->get_session(); 110 } 111 return undef; 112 } 113 114 85 115 sub get_value { 86 116 87 117 my ($self, $name) = @_; … … 211 241 tie %session, 'Apache::Session::Memcached', $sid, { 212 242 Handler => $keeper->{session}->MEMD, 213 243 Expiration => $state->{session}->{lifetime}, 214 # Servers => $state->{session}->memcached_servers, 215 # NoRehash => 1, 216 # Readonly => 0, 217 # Debug => $DEBUG, 218 # CompressThreshold => 10_000 219 244 }; 220 245 }; 221 246 } else { … … 249 274 tie %session, 'Apache::Session::Memcached', undef, { 250 275 Handler => $keeper->{session}->MEMD, 251 276 Expiration => $state->{session}->{lifetime}, 252 # Servers => $state->{session}->memcached_servers, 253 # NoRehash => 1, 254 # Readonly => 0, 255 # Debug => $DEBUG, 256 # CompressThreshold => 10_000 257 277 }; 258 278 }; 259 279 } else { 260 280 eval { 261 281 tie %session, 'Apache::Session::File', undef, { 262 Directory => $state->session->session_dir, 282 Directory => $state->{session}->session_dir, 263 283 }; 264 284 }; 265 285 } -
koi8/plugins/session/lib/session/State.pm.proto
11 11 my $self = {}; 12 12 bless $self, $class; 13 13 14 # ������� ������������ ������� 14 # configured 15 15 $self->{project} = '@PROJECT@'; 16 $self->{debug} = (lc('@DEBUG@') eq 'yes'); 17 $self->{project_name} = '@PROJECT_NAME@'; 18 $self->{default_expire} = '@DEFAULT_EXPIRE@' || 300; 19 $self->{default_object_expire} ='@DEFAULT_OBJECT_EXPIRE@' || 600; 16 20 21 # ������� ������������ ������� 17 22 $self->{db_type} = 'none'; 18 23 $self->{storage} = '@SESSION_STORAGE@' || 'FILE'; ## ��������: FILE POSTGRES MEMCACHED 19 24 $self->{session_dir} = '@SESSIONS@'; … … 38 43 $self->{images_directory} = ''; 39 44 $self->{binary_directory} = ''; 40 45 $self->{preview} = ''; 41 $self->{debug} = ''; 42 46 $self->{store_method} = ''; 43 47 $self->{cascade} = ''; 44 48