| 466 | | function getIdentityFromUserTable($accountid) |
|---|
| 467 | | { |
|---|
| 468 | | global $claimslist, $wpdb, $datamap; |
|---|
| 469 | | |
|---|
| 470 | | $user_info['found'] = FALSE; |
|---|
| 471 | | $user_info['error'] = ''; |
|---|
| 472 | | |
|---|
| 473 | | $query = "SELECT * from " . PW_TABLE_PREFIX |
|---|
| 474 | | . "users WHERE user_email LIKE '" |
|---|
| 475 | | . $claimslist['emailaddress']->token_value . "'"; |
|---|
| 476 | | |
|---|
| 477 | | $user_info = $wpdb->get_results( $query, ARRAY_A ); |
|---|
| 478 | | |
|---|
| 479 | | switch (count($user_info)) |
|---|
| 480 | | { |
|---|
| 481 | | case 1: |
|---|
| 482 | | // |
|---|
| 483 | | pw_utils::printDebug(' User Data found & mapped.<br />' ); |
|---|
| 484 | | foreach (array_keys($datamap) as $key) |
|---|
| 485 | | { |
|---|
| 486 | | if (array_key_exists($datamap[$key]->mappingattribute, $user_info[0])) |
|---|
| 487 | | { |
|---|
| 488 | | $datamap[$key]->add_db_value($user_info[0][$datamap[$key]->mappingattribute]); |
|---|
| 489 | | pw_utils::printDebug('Added: ' . $datamap[$key]->db_value . '<br />'); |
|---|
| 490 | | } |
|---|
| 491 | | } |
|---|
| 492 | | |
|---|
| 493 | | if ( PW_CUSTOM_DATA ) |
|---|
| 494 | | pw_customdata::evaluateIncomingCustomData( $accountid ); |
|---|
| 495 | | break; |
|---|
| 496 | | break; |
|---|
| 497 | | |
|---|
| 498 | | case 0: |
|---|
| 499 | | pw_utils::printDebug('Card not found.<br />' ); |
|---|
| 500 | | break; |
|---|
| 501 | | default: |
|---|
| 502 | | pw_utils::printDebug(' getIdentityFromUserTable: Multiple user accounts have the same ID.<br />' ); |
|---|
| 503 | | $card_info['error'] = "USERIDNOTUNIQUE"; |
|---|
| 504 | | } |
|---|
| 505 | | } //end function getIdentityFromUserTable |
|---|
| 506 | | |
|---|