Revision 312

Date:
2013/04/24 18:06:57
Author:
ahitrov
Revision Log:
Vkontakte credential auth
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/session/lib/session/AUTH/VKontakte.pm

     
    149 149 my $user;
    150 150 if ( $state->{users}->use_credentials ) {
    151 151 $user = $keeper->{users}->get_profile( vkontakte => $user_info->{uid} );
    152 } else {
    152 }
    153 unless ( ref $user ) {
    153 154 $user = $keeper->{users}->get_profile( login => 'vkontakte:'.$user_info->{uid} );
    154 155 }
    155 156 unless ( ref $user ) {
     
    172 173 }
    173 174
    174 175 $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 }
    181 176 } else {
    182 177 my ($prop_ava) = grep { $_->{attr} eq 'avatar' && $_->{type} eq 'image' } $user->structure;
    183 178 if ( ref $prop_ava ) {
     
    190 185 }
    191 186 }
    192 187 }
    188 if ( $state->{users}->use_credentials ) {
    189 $user->create_credential(
    190 vkontakte => $user_info->{uid},
    191 avatar => $user_info->{photo_big},
    192 );
    193 }
    193 194 my %data = (
    194 195 id => $user->id,
    195 196 name => $name,