Revision 314

Date:
2013/04/24 18:20:50
Author:
ahitrov
Revision Log:
Bugged create_credential
Files:

Legend:

 
Added
 
Removed
 
Modified
  • utf8/plugins/users/lib/users/UserProfile.pm

     
    217 217 if ( $opts{vkontakte} ) {
    218 218 ($object) = $self->keeper->get_documents(
    219 219 class => 'users::OA::VK',
    220 uid => $self->id,
    221 220 ext_id => $opts{vkontakte},
    222 221 limit => 1,
    223 222 );
     
    225 224 unless ( ref $object ) {
    226 225 $object = users::OA::VK->new ($keeper);
    227 226 $object->name( $opts{name} );
    227 $object->ext_id( $opts{vkontakte} );
    228 228 $object->status( 1 );
    229 229 $object->opaque( $opts{opaque} || 0 );
    230 230 $object->uid( $self->id );
     
    234 234 } elsif ( $opts{facebook} ) {
    235 235 ($object) = $self->keeper->get_documents(
    236 236 class => 'users::OA::FaceBook',
    237 uid => $self->id,
    238 237 ext_id => $opts{facebook},
    239 238 limit => 1,
    240 239 );
     
    242 241 unless ( ref $object ) {
    243 242 $object = users::OA::FaceBook->new ($keeper);
    244 243 $object->name( $opts{name} );
    244 $object->ext_id( $opts{facebook} );
    245 245 $object->status( 1 );
    246 246 $object->opaque( $opts{opaque} || 0 );
    247 247 $object->uid( $self->id );
     
    251 251 } elsif ( $opts{google} ) {
    252 252 ($object) = $self->keeper->get_documents(
    253 253 class => 'users::OA::Google',
    254 uid => $self->id,
    255 254 ext_id => $opts{google},
    256 255 limit => 1,
    257 256 );
     
    259 258 unless ( ref $object ) {
    260 259 $object = users::OA::Google->new ($keeper);
    261 260 $object->name( $opts{name} );
    261 $object->ext_id( $opts{google} );
    262 262 if ( $opts{email} ) {
    263 263 $object->email( $opts{email} );
    264 264 $self->create_credential( email => $opts{email}, status => 1 );
     
    272 272 } elsif ( $opts{mailru} ) {
    273 273 ($object) = $self->keeper->get_documents(
    274 274 class => 'users::OA::Mailru',
    275 uid => $self->id,
    276 275 ext_id => $opts{mailru},
    277 276 limit => 1,
    278 277 );
     
    280 279 unless ( ref $object ) {
    281 280 $object = users::OA::Mailru->new ($keeper);
    282 281 $object->name( $opts{name} );
    282 $object->ext_id( $opts{mailru} );
    283 283 if ( $opts{email} ) {
    284 284 $object->email( $opts{email} );
    285 285 $self->create_credential( email => $opts{email}, status => 1 );