Revision 410
- Date:
- 2014/01/28 17:46:48
- Files:
Legend:
- Added
- Removed
- Modified
-
utf8/plugins/session/lib/session/AUTH/FaceBook.pm
204 204 } 205 205 } 206 206 my %data = session::Keeper::_get_hash_from_profile( $user ); 207 $data{auth_by} = 'facebook'; 207 208 $data{avatar} ||= 'https://graph.facebook.com/'.$info->{username}.'/picture'; 208 209 $data{email} ||= $email if $email; 209 210 $local_session->set( %data ); -
utf8/plugins/session/lib/session/AUTH/VKontakte.pm
175 175 my ($prop_ava) = grep { $_->{attr} eq 'avatar' && $_->{type} eq 'image' } $user->structure; 176 176 if ( ref $prop_ava ) { 177 177 my $avatar = $user->_store_image( $user_info->{photo_big}, attr => 'avatar' ); 178 local $Data::Dumper::Indent = 0; 179 $user->avatar( Data::Dumper::Dumper($avatar) ); 178 $user->avatar( $user->_serialize($avatar) ); 180 179 } 181 180 182 181 $user->store; … … 186 185 my $avatar = $user->get_image( 'avatar' ); 187 186 unless ( ref $avatar && exists $avatar->{filename} ) { 188 187 my $avatar = $user->_store_image( $user_info->{photo_big}, attr => 'avatar' ); 189 local $Data::Dumper::Indent = 0; 190 $user->avatar( Data::Dumper::Dumper($avatar) ); 188 $user->avatar( $user->_serialize($avatar) ); 191 189 $user->store; 192 190 } 193 191 } … … 198 196 avatar => $user_info->{photo_big}, 199 197 ); 200 198 } 201 my %data = ( 202 id => $user->id, 203 name => $name, 204 login => $user->login, 205 status => $user->status, 206 type => $user->type, 207 auth_by => 'vkontakte', 208 ltime => time, 209 ); 199 my %data = session::Keeper::_get_hash_from_profile( $user ); 200 $data{auth_by} = 'vkontakte'; 210 201 if ( $user_info->{photo} ) { 211 $data{avatar} = $user_info->{photo}; 202 $data{avatar} ||= $user_info->{photo}; 212 203 } 213 204 $local_session->set( %data ); 214 205