Changeset 159
- Timestamp:
- 03/14/08 08:34:33 (10 months ago)
- Files:
-
- branches/RB-0.91/wp-infocard/wp/admin.pw.php (modified) (2 diffs)
- branches/RB-0.91/wp-infocard/wp/processing.pw.php (modified) (2 diffs)
- branches/RB-0.91/wp-infocard/wp/userdata.pw.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/RB-0.91/wp-infocard/wp/admin.pw.php
r155 r159 611 611 . PW_IMGURL . '/infocard_30x21_disabled.png"' 612 612 . " style='vertical-align: middle'/> " 613 . "</td><td colspan='5'><a href=' '>"613 . "</td><td colspan='5'><a href='" . pw_admin::cardAssociationUrl() . "'>" 614 614 . "Attach a new Information Card" 615 615 . "</a></td></tr>"; … … 618 618 return $output; 619 619 } 620 621 /* 622 Function: cardAssociationUrl 623 Description: prints out the URL to associate a card to an authenticated account 624 Input: none 625 Output: URL 626 Side-Effects: none 627 */ 628 function cardAssociationUrl() 629 { 630 return PW_SECUREPLUGINURL . '/' . PW_PLUGIN . '/login/infocard-newcard.php'; 631 } 620 632 } // end class pw_admin 621 633 ?> branches/RB-0.91/wp-infocard/wp/processing.pw.php
r158 r159 23 23 { 24 24 pw_utils::printDebugHeader('Final Analysis'); 25 pw_utils::printDebug(" User: ".$datamap['display_name']->new_value."<br />"); 26 pw_utils::printDebug(" Login ID: ".$datamap['user_login']->new_value."<br />"); 27 pw_utils::printDebug(" Account ID: ".$datamap['ID']->new_value."<br />"); 25 if ($datamap) 26 { 27 pw_utils::printDebug(" User: ".$datamap['display_name']->new_value."<br />"); 28 pw_utils::printDebug(" Login ID: ".$datamap['user_login']->new_value."<br />"); 29 pw_utils::printDebug(" Account ID: ".$datamap['ID']->new_value."<br />"); 30 } 28 31 pw_utils::printDebug(" User Status: ".$status." <br/>"); 29 32 … … 122 125 return $results; 123 126 } // end function getCardInfo 127 128 /* 129 Function: lookupCardHash 130 Description: attempts to retrieve a card hash record from the identities table 131 Input: cardhash: the hash to look up 132 Output: Object containing Card Hash, if present (null otherwise) 133 Side-Effects: none 134 */ 135 function lookupCardHash($cardhash) 136 { 137 if (!$cardhash) 138 return NULL; 139 140 global $wpdb; 141 $query = "SELECT * FROM wp_infocard_identities WHERE " 142 . "cardhash = '$cardhash'"; 143 144 $results = $wpdb->get_results( $query, OBJECT ); 145 return $results; 146 } // end function lookupCardHash 147 148 /* 149 Function: addIdentityRecord 150 Description: updates the identity table with a new record 151 Input: cardhash, cardhandle, accountid 152 Output: FALSE on error, TRUE on success 153 Side-Effect: updates infocard_identities table 154 */ 155 function addIdentityRecord($cardhash,$cardhandle,$accountid) 156 { 157 if (!$cardhash || !$cardhandle || !$accountid) 158 return FALSE; 159 $today = date('c'); 160 global $wpdb; 161 $query = "INSERT INTO `" . PW_PLUGIN . "_infocard_identities` " 162 . "( cardhash, cardhandle, accountid, startdate, lastused ) VALUES " 163 . "( '$cardhash', '$cardhandle', '$accountid', '$today', '$today' )"; 164 165 if ($wpdb->query( $query )) 166 return TRUE; 167 else 168 return FALSE; 169 } 124 170 } // end class pw_processing 125 171 ?> branches/RB-0.91/wp-infocard/wp/userdata.pw.php
r156 r159 188 188 $cardhandle = $datamap['cardhandle']->new_value; 189 189 $today = date('c'); 190 191 //$query = "SELECT * FROM wp_infocard_identities WHERE (ppid = '$ppid' "192 //. "AND modulusHash = '$modulus') OR (accountid = '$acct')";193 190 194 191 $query = "SELECT * FROM wp_infocard_identities WHERE cardHash = '$cardhash' " … … 233 230 pw_utils::printDebug( " Updated card 'last used' date<br/>" ); 234 231 } 235 break;236 237 232 default: 238 // should never happen 239 return 'MULTIPLECARDERROR'; 233 return 'MULTIPLES'; 240 234 } 241 235
