Changeset 218566
- Timestamp:
- 03/17/2010 02:44:39 AM (16 years ago)
- Location:
- cross-registration-integration
- Files:
-
- 5 added
- 2 edited
-
tags/1.2 (added)
-
tags/1.2/GNU General Public License.txt (added)
-
tags/1.2/cross-registration-integration.php (added)
-
tags/1.2/readme.txt (added)
-
tags/1.2/screenshot-1.jpg (added)
-
trunk/cross-registration-integration.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cross-registration-integration/trunk/cross-registration-integration.php
r214456 r218566 4 4 Plugin URI: http://www.gkauten.com/cross-registration-integration 5 5 Description: Integrates with the WordPress registration process to assist with the registration process for other systems. Meaning, this plugin will simultaneously transmit the user's information entered in to your WordPress registration page to a URL you specify which can then handle creating a duplicate user account within your other systems on your website. 6 Version: 1. 16 Version: 1.2 7 7 Author: GKauten 8 8 Author URI: http://www.gkauten.com … … 330 330 331 331 <h3>Example Transaction</h3> 332 <p><?php echo get_option("cri_transurl")."?".get_option("cri_ wp_username_as")."=___________&".get_option("cri_wp_email_as")."=___________&".get_option("cri_wp_password_as")."=___________".get_option("cri_special_params"); ?></p>332 <p><?php echo get_option("cri_transurl")."?".get_option("cri_special_params"); ?></p> 333 333 334 334 <p style="padding: 20px;"> … … 414 414 $profile_field_ids = explode( ',', $_POST['signup_profile_field_ids'] ); 415 415 // Loop through the posted fields formatting any datebox values then add to $data 416 $data = "";416 $data = array(); 417 417 foreach((array) $profile_field_ids as $field_id) { 418 418 if(!isset($_POST['field_' . $field_id])) { … … 421 421 } 422 422 } 423 $data .= "field_" . $field_id . "=" . $_POST['field_' . $field_id] . "&";423 $data["field_" . $field_id] = $_POST['field_' . $field_id]; 424 424 } 425 425 } … … 440 440 function cri_cross_register($user_login, $user_email, $user_pass, $data = null) { 441 441 global $cri_system; 442 443 442 // Exit if Transaction URL is empty 444 443 if(get_option("cri_transurl") == "" || get_option("cri_transurl") === false) return; 445 446 444 // Encryption 447 445 switch(get_option("cri_encrypt")) { … … 452 450 break; 453 451 } 454 455 452 // Initiate Appropriate System Variables 456 if($cri_system == "word") { 457 $username_as = get_option("cri_wp_username_as"); 458 $email_as = get_option("cri_wp_email_as"); 459 $password_as = get_option("cri_wp_password_as"); 460 } elseif($cri_system == "buddy") { 453 if($cri_system == "buddy") { 461 454 $username_as = get_option("cri_bp_username_as"); 462 455 $email_as = get_option("cri_bp_email_as"); 463 456 $password_as = get_option("cri_bp_password_as"); 464 457 } else { 465 $username_as = "username"; 466 $email_as = "email"; 467 $password_as = "password"; 468 } 469 458 $username_as = get_option("cri_wp_username_as"); 459 $email_as = get_option("cri_wp_email_as"); 460 $password_as = get_option("cri_wp_password_as"); 461 } 470 462 // Begin Cross Registration 471 $params = ""; 472 $params .= $username_as . "=" . $user_login . "&"; 473 $params .= $email_as . "=" . $user_email . "&"; 474 $params .= $password_as . "=" . $user_pass . "&"; 475 463 $params = array(); 464 $params[$username_as] = $user_login; 465 $params[$email_as] = $user_email; 466 $params[$password_as] = $user_pass; 476 467 // Add Extra Data Fields 477 468 if($data) { 478 $params .= $data; 479 } 480 469 $params = array_merge($params, $data); 470 } 481 471 // Add Special Parameters 482 472 if(get_option("cri_special_params") != "") { 483 $params .= get_option("cri_special_params"); 484 } 485 486 $r = cri_http(get_option("cri_transurl") . "?" . $params); 473 $special = get_option("cri_special_params"); 474 if(strstr($special, "&")) { 475 // Assume Multiple Params 476 $temp_spec = array(); 477 $temp_spec = explode("&", $special); 478 if(count($temp_spec)) { 479 foreach($temp_spec as $spec) { 480 $params[substr($spec, 0, strpos($spec, "="))] = substr($spec, strpos($spec, "=") + 1); 481 } 482 } 483 } else { 484 $params[substr($special, 0, strpos($special, "="))] = substr($special, strpos($special, "=") + 1); 485 } 486 } 487 $r = cri_http(get_option("cri_transurl"), $params); 487 488 } 488 489 … … 491 492 /************************************/ 492 493 493 function cri_http($url) { 494 $params = array('http' => array( 495 'method' => 'post', 496 'content' => strstr($url, "?") 497 )); 498 499 $ctx = stream_context_create($params); 500 $fp = @fopen($url, 'rb', false, $ctx); 501 502 if (!$fp) { 503 exit("Problem with $url, $php_errormsg"); 504 } 505 506 $response = @stream_get_contents($fp); 507 508 if ($response === false) { 509 exit("Problem reading data from $url, $php_errormsg"); 510 } 511 512 return $response; 494 function cri_http($url, $post_fields = "") { 495 $postfields = array(); 496 if(count($post_fields)) { 497 foreach($post_fields as $i => $f) { 498 $postfields[] = urlencode($i) . '=' . urlencode($f); 499 } 500 } 501 $fields = implode('&', $postfields); 502 $opts = array( 503 'http'=>array( 504 'method' => "POST", 505 'header' => "Content-Type: application/x-www-form-urlencoded\r\n" . 506 "Content-Length: " . strlen($fields) . "\r\n\r\n" . 507 $fields 508 ) 509 ); 510 $context = stream_context_create($opts); 511 $fp = @fopen($url, 'rb', false, $context); 512 @fclose($fp); 513 513 } 514 514 -
cross-registration-integration/trunk/readme.txt
r214456 r218566 5 5 Requires at least: 2.8.6 6 6 Tested up to: 2.9.2 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 9 9 Integrates with the WordPress registration process to assist with the registration process for other systems. … … 24 24 fields are transmitted to the Transaction URL once a user completes the BuddyPress controlled registration page. 25 25 26 Version 1.1 introduce sone new feature and an enhancement to an existing feature. The amount of delay that was27 previously experienced while waiting for the call to the Transaction URL has beenoptimized to only add an26 Version 1.1 introduced one new feature and an enhancement to an existing feature. The amount of delay that was 27 previously experienced while waiting for the call to the Transaction URL was optimized to only add an 28 28 additional second or two to the overall load time. As for new features, on BuddyPress installations the profile 29 fields will now also bepassed along. However, because of the dynamic nature of these fields there is not a29 fields are also passed along. However, because of the dynamic nature of these fields there is not a 30 30 feasible way to assign new names to them as they pass so they will maintain their original form names (i.e - 31 31 field_1, field_2, etc... going down as an ordered list). 32 33 Version 1.2 further optimizes the methods by which the Transaction URL is called and respective form data passed. 34 Because the plugin uses a POST method, the receiving server should be expecting a POST as well. A later version 35 is planned to allow for the selection of either a GET or POST transaction. This version also confirms the ability 36 to work with the infamous MailChimp mailing system. For details regarding how to integrate with your MailChimp 37 list, please refer to http://www.gkauten.com/cross-registration-integration-meets-mailchimp. 32 38 33 39 If you find this plugin useful, please donate. Donations help pay for the massive amount of energy drinks … … 66 72 == Changelog == 67 73 74 = 1.2 = 75 * Improved transaction post method. 76 * Verified ability to integrate with the MailChimp email marketing system. 77 68 78 = 1.1 = 69 79 * Reduced the amount of time required to process the Transaction URL transmission on registration. … … 89 99 == Upgrade Notice == 90 100 101 = 1.2 = 102 This version further enhanced the Transaction URL call methods and optimized field delivery. It also confirms integration with the MailChimp email marketing system. 103 91 104 = 1.1 = 92 105 This version reduces the amount of time required to process the Transaction URL transmission on registration and includes the Profile fields for BuddyPress installations.
Note: See TracChangeset
for help on using the changeset viewer.