Changeset 95
- Timestamp:
- 07/31/07 16:34:40 (1 year ago)
- Files:
-
- branches/TRY-PD-phpInfoCard/wp-infocard/wp/clickback.pw.php (modified) (1 diff)
- branches/TRY-PD-phpInfoCard/wp-infocard/wp/processing.pw.php (added)
- branches/TRY-PD-phpInfoCard/wp-infocard/wp/pw-claimtypes.php (modified) (1 diff)
- branches/TRY-PD-phpInfoCard/wp-infocard/wp/userdata.pw.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/TRY-PD-phpInfoCard/wp-infocard/wp/clickback.pw.php
r61 r95 69 69 } // end of function verifyChallenge 70 70 71 // Function: sendAccountValidation 72 // Description: creates & emails a validation message to the user 73 // Input: clickbackID: pre-created clickback value 74 // user email: destination email 75 // Output: none 76 // Side-effects: sends an email 71 /* 72 Function: validateClickback 73 Description: returns true if the supplied candidate matches 74 a newly generated clickback 75 Input: candidate - the clickback value to validate 76 user_email - email address from the token 77 user_ppid - privatepersonalidentifier from the token 78 Output: boolean 79 Side Effects: none 80 */ 81 function validateClickback($candidate, $user_email, $user_ppid) 82 { 83 pw_utils::printDebug(" Clickback posted<br/>"); 84 85 $challengeContent = $user_email . $user_ppid; 86 $clickbackUrl = pw_clickback::createChallenge($challengeContent); 87 $previousChallenge = trim($candidate); 88 89 return pw_clickback::verifyChallenge($clickbackUrl, $previousChallenge); 90 91 } 92 93 /* 94 Function: sendAccountValidation 95 Description: creates & emails a validation message to the user 96 Input: clickbackID: pre-created clickback value 97 user email: destination email 98 Output: none 99 Side Effects: sends an email 100 */ 77 101 function sendAccountValidation( $clickbackID, $user_email ) 78 102 { branches/TRY-PD-phpInfoCard/wp-infocard/wp/pw-claimtypes.php
r94 r95 75 75 'Calls out to the getLoginID function in pw_userdata' ); 76 76 77 $datamap['ID'] = new pw_mapping( 78 'Account ID', 79 'ID', 80 PW_TABLE_PREFIX . 'users', 81 'return pw_userdata::getAccountID();', 82 'Calls out to the getAccountID function in pw_userdata' ); 83 77 84 $datamap['first_name'] = new pw_mapping( 78 85 'First Name', branches/TRY-PD-phpInfoCard/wp-infocard/wp/userdata.pw.php
r84 r95 48 48 $query = "SELECT * FROM `" . PW_TABLE_PREFIX 49 49 . "infocard_identities` WHERE modulusHash = '" 50 . $claimslist['modulusHash']->token_value50 . substr_replace($claimslist['signerkeymodulus']->token_value, '', 128, -1) 51 51 . "' AND ppid = '" 52 52 . $claimslist['privatepersonalidentifier']->token_value 53 53 . "'"; 54 pw_utils::printDebug($query); 54 55 $identity_info = $wpdb->get_results( $query, OBJECT ); 55 56 … … 231 232 } //end function getLoginID 232 233 234 /* Function: getAccountID 235 Description: only returns the existing value. 236 Input: none 237 Output: existing Account ID 238 Side Effects: none 239 */ 240 function getAccountID() 241 { 242 global $datamap; 243 return ($datamap['ID']->db_value)?$datamap['ID']->db_value:''; 244 } // end function getAccountID 245 233 246 // Function: updateUserData 234 247 // Description: in order to do definitive account lookup with a card, … … 342 355 343 356 } //end function getUserPPID 344 345 // Function: Perform user login functions 346 // Description: set whatever cookie &/or session information needed 347 // for an authenticated user. 348 // Returns: 357 358 /* 359 Function: Perform user login functions 360 Description: set whatever cookie &/or session information needed 361 for an authenticated user. 362 Input: user id 363 Output: true if the authentication succeeded, false otherwise. 364 */ 365 349 366 function doUserLogin( $id ) 350 367 { … … 354 371 . "WHERE ID = '". $id . "' AND user_login = '" 355 372 . $datamap['user_login']->db_value . "'"; 356 $ user_pass = $wpdb->get_var( $query );357 if (!$ user_pass)373 $pass = $wpdb->get_var( $query ); 374 if (!$pass) 358 375 { 359 376 // this might be a new user 360 377 $user_pass = $datamap['modulusHash']->new_value; 361 378 } 362 $user_url = ($datamap['user_url']?$datamap['user_url']->new_value:""); 363 pw_userdata::setLoginCookies($datamap['user_login']->db_value, $user_pass, $datamap['display_name']->new_value, $datamap['user_email']->new_value, $user_url); 379 $url = ($datamap['user_url']?$datamap['user_url']->new_value:""); 380 pw_userdata::setLoginCookies($datamap['user_login']->db_value, $pass, $datamap['display_name']->new_value, $datamap['user_email']->new_value, $url); 381 382 if (is_user_logged_in()) 383 return TRUE; 384 else 385 return FALSE; 364 386 } //end function doUserLogin 365 387
