Changeset 98
- Timestamp:
- 08/01/07 20:30:24 (1 year ago)
- Files:
-
- trunk/wp-infocard (modified) (1 prop)
- trunk/wp-infocard/pw-config.php (modified) (1 diff)
- trunk/wp-infocard/pwlib (deleted)
- trunk/wp-infocard/vendor (deleted)
- trunk/wp-infocard/wp/clickback.pw.php (modified) (2 diffs)
- trunk/wp-infocard/wp/login/infocard-clickback.php (modified) (1 diff)
- trunk/wp-infocard/wp/login/infocard-login.php (modified) (1 diff)
- trunk/wp-infocard/wp/processing.pw.php (copied) (copied from branches/TRY-PD-phpInfoCard/wp-infocard/wp/processing.pw.php)
- trunk/wp-infocard/wp/pw-claimtypes.php (modified) (3 diffs)
- trunk/wp-infocard/wp/userdata.pw.php (modified) (4 diffs)
- trunk/wp-infocard/wp/utils.pw.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-infocard
- Property svn:externals set to
pwlib https://pamelaproject.com/svn/pw/pwcommon/trunk/pwlib
vendor https://pamelaproject.com/svn/pw/pwcommon/trunk/vendor
legal https://pamelaproject.com/svn/pw/pwcommon/trunk/legal
- Property svn:externals set to
trunk/wp-infocard/pw-config.php
r84 r98 26 26 define ('PW_SITEMESGURL', PW_PLUGINURL . '/site-messages/infocard-usermessage.php'); 27 27 define ('PW_SECURESITEURL', get_settings('securesiteurl') ); 28 define ('PW_PHPINFOCARDPATH', PW_PATH . '/pwlib/vendor/phpInfoCard'); 28 29 29 30 if ( PW_CUSTOM_DATA) trunk/wp-infocard/wp/clickback.pw.php
r61 r98 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 { … … 80 104 $clickbackUrl = PW_SECUREPLUGINURL . "/" . PW_PLUGIN . "/login/infocard-clickback.php?clickbackID=" . $clickbackID; 81 105 82 $message = sprintf('Please complete your registration at %s by opening the link below.', pw_utils:: printTitle()) . "\r\n\r\n";106 $message = sprintf('Please complete your registration at %s by opening the link below.', pw_utils::getTitle()) . "\r\n\r\n"; 83 107 $message .= $clickbackUrl."\r\n\r\nThanks\r\n"; 84 108 // sendEmail: to-address, subject, body trunk/wp-infocard/wp/login/infocard-clickback.php
r67 r98 41 41 <div id="pw_login_main"> 42 42 <div id="pw_login_header"> 43 <h1><?php pw_utils::screenPrint('Verify your account at: ' ) . pw_utils::printTitle(); ?></h1>43 <h1><?php pw_utils::screenPrint('Verify your account at: ' . pw_utils::getTitle()); ?></h1> 44 44 </div> 45 45 <div id="pw_login_links"> trunk/wp-infocard/wp/login/infocard-login.php
r63 r98 34 34 <div id="pw_login_main"> 35 35 <div id="pw_login_header"> 36 <h1><?php pw_utils::screenPrint('Information Card Login: ' ) . pw_utils::printTitle(); ?></h1>36 <h1><?php pw_utils::screenPrint('Information Card Login: ' . pw_utils::getTitle()); ?></h1> 37 37 </div> 38 38 <div id="pw_login_links"> trunk/wp-infocard/wp/pw-claimtypes.php
r84 r98 7 7 'PPID'); 8 8 9 $claimslist[' modulusHash'] = new pw_claimtype(9 $claimslist['signerkeymodulus'] = new pw_claimtype( 10 10 '', 11 ' modulusHash',11 'signerkeymodulus', 12 12 TRUE, 13 13 'Modulus'); … … 60 60 'modulusHash', 61 61 PW_TABLE_PREFIX . 'infocard_identities', 62 'return $' . 'claimslist[\' modulusHash\']->token_value;' );62 'return $' . 'claimslist[\'signerkeymodulus\']->token_value;' ); 63 63 64 64 $datamap['privatepersonalidentifier'] = new pw_mapping( … … 74 74 'return pw_userdata::getLoginID();', 75 75 'Calls out to the getLoginID function in pw_userdata' ); 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' ); 76 83 77 84 $datamap['first_name'] = new pw_mapping( trunk/wp-infocard/wp/userdata.pw.php
r84 r98 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 wp_set_current_user( $id ); 383 384 if (is_user_logged_in()) 385 return true; 386 else 387 return false; 388 364 389 } //end function doUserLogin 365 390 trunk/wp-infocard/wp/utils.pw.php
r66 r98 63 63 } 64 64 } // end function printTitle 65 66 /* 67 Function: getTitle 68 Description: returns the site title 69 Input: none 70 Output: string representing the title 71 Side Effects: none 72 */ 73 function getTitle() 74 { 75 if ( function_exists('get_settings') ) 76 return get_settings('blogname'); 77 else 78 return PW_SECURESITEURL; 79 } // end function getTitle 65 80 66 81 function printHomeLink(){
