Revision 308
- Date:
- 2013/04/24 10:45:39
- Files:
Legend:
- Added
- Removed
- Modified
-
utf8/plugins/session/lib/session/AUTH/VKontakte.pm
146 146 my @plugins = split (/[\ |\t]+/, $state->{plugins}); 147 147 my $name = $user_info->{first_name}.' '.$user_info->{last_name}; 148 148 if ( grep { $_ eq 'users' } @plugins ) { 149 my $user = $keeper->{users}->get_profile( login => 'vkontakte:'.$user_info->{uid} ); 149 my $user; 150 if ( $state->{users}->use_credentials ) { 151 $user = $keeper->{users}->get_profile( vkontakte => $user_info->{uid} ); 152 } else { 153 $user = $keeper->{users}->get_profile( login => 'vkontakte:'.$user_info->{uid} ); 154 } 150 155 unless ( ref $user ) { 151 156 my $user_class = $state->{users}->profile_document_class; 152 157 $user = $user_class->new( $keeper ); … … 167 172 } 168 173 169 174 $user->store; 175 if ( $state->{users}->use_credentials ) { 176 $user->create_credential( 177 vkontakte => $user_info->{uid}, 178 avatar => $user_info->{photo_big}, 179 ); 180 } 170 181 } else { 171 182 my ($prop_ava) = grep { $_->{attr} eq 'avatar' && $_->{type} eq 'image' } $user->structure; 172 183 if ( ref $prop_ava ) {