Revision 370

Date:
2013/07/16 16:27:05
Author:
ahitrov
Revision Log:
Country property check

Files:

Legend:

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

     
    163 163 unless ( ref $user ) {
    164 164 my $user_class = $state->{users}->profile_document_class;
    165 165 $user = $user_class->new( $keeper );
    166 my %props = map { $_->{attr} => $_ } $user->structure;
    166 167 $user->login( $info->{email} || 'google:'.$info->{id} );
    167 168 $user->name( $name );
    168 169 $user->status( 1 );
    169 170 $user->type( 0 );
    170 171 $user->login_method('google');
    171 if ( $info->{locale} ) {
    172 if ( exists $props{country} && $info->{locale} ) {
    172 173 $user->country( $info->{locale} );
    173 174 }
    174 175 if ( $info->{birthday} && $info->{birthday} =~ /(\d{2})\.(\d{2})\.(\d{4})/ ) {
  • utf8/plugins/session/lib/session/AUTH/Mailru.pm

     
    179 179 unless ( ref $user ) {
    180 180 my $user_class = $state->{users}->profile_document_class;
    181 181 $user = $user_class->new( $keeper );
    182 my %props = map { $_->{attr} => $_ } $user->structure;
    182 183 $user->login( $info->{email} || 'mailru:'.$info->{uid} );
    183 184 $user->name( $name );
    184 185 $user->nickname( $info->{nick} );
    185 186 $user->status( 1 );
    186 187 $user->type( 0 );
    187 188 $user->login_method('mailru');
    188 if ( $info->{location} ) {
    189 if ( exists $props{country} && $info->{location} ) {
    189 190 $user->country( Encode::encode('utf-8', $info->{location}{country}{name}) );
    190 191 }
    191 192 if ( $info->{birthday} && $info->{birthday} =~ /(\d{2})\.(\d{2})\.(\d{4})/ ) {
  • utf8/plugins/session/lib/session/AUTH/VKontakte.pm

     
    160 160 unless ( ref $user ) {
    161 161 my $user_class = $state->{users}->profile_document_class;
    162 162 $user = $user_class->new( $keeper );
    163 my %props = map { $_->{attr} => $_ } $user->structure;
    163 164 $user->login( 'vkontakte:'.$user_info->{uid} );
    164 165 $user->name( $user_info->{last_name}.', '.$user_info->{first_name} );
    165 166 $user->nickname( $user_info->{nickname} );
    166 167 $user->status( 1 );
    167 168 $user->type( 0 );
    168 169 $user->login_method('vkontakte');
    169 $user->country( $user_info->{country} );
    170 if ( exists $props{country} ) {
    171 $user->country( $user_info->{country} );
    172 }
    170 173 $user->email( undef );
    171 174
    172 175 my ($prop_ava) = grep { $_->{attr} eq 'avatar' && $_->{type} eq 'image' } $user->structure;