From 971593038a662bc433034799ea46b47f1703cda8 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 7 Sep 2017 15:34:20 -0400 Subject: [PATCH] Updates for event reg magic forms Getting this to work on localhost machine. Pushing changes to test on dev55 server. --- registrations/functions.php | 15 +++++----- registrations/registrations.php | 49 ++++++++++++++++++--------------- registrations/siteinfo.php | 2 +- 3 files changed, 36 insertions(+), 30 deletions(-) diff --git a/registrations/functions.php b/registrations/functions.php index b18e797..183f31c 100644 --- a/registrations/functions.php +++ b/registrations/functions.php @@ -123,21 +123,22 @@ function credit_card_check( $Num, $accepted = SI_CC_ACCEPTS ) // Permit secret test code - if( $Num == "0011001100110011" ) + if ( $Num == "0011001100110011" ) { return( "Test" ); - else - { + } else { // Check each selected card type for a pattern match $Name = ""; - reset( $si_cc_verify ); + //reset( $si_cc_verify ); $i = 0; - while( list($k, $v) = each($si_cc_verify) ) + //while( list($k, $v) = each($si_cc_verify) ) + foreach ( $GLOBALS['si_cc_verify'] as $k => $v ) { if( ( $accepted & pow(2,$i++) ) && preg_match( "/$v/", $Num ) ) { $Name = $k; break; - } - } + } + } + } // Fail if nothing matched diff --git a/registrations/registrations.php b/registrations/registrations.php index f6b2dda..0348795 100644 --- a/registrations/registrations.php +++ b/registrations/registrations.php @@ -24,9 +24,10 @@ $gArray = array( 'ccmonth', 'ccyear', 'conf', + 'rate_class', ); foreach ( $gArray as $gArr ) { - $GLOBALS[$gArr] = ${$gArr}; + $GLOBALS[$gArr] = $_REQUEST[$gArr]; } /***************************************************** * @@ -50,6 +51,7 @@ foreach ( $gArray as $gArr ) { function cleanup( $varname ) { $GLOBALS[$varname] = stripslashes( trim($GLOBALS[$varname]) ); + $_REQUEST[$varname] = $GLOBALS[$varname]; } $link_data = ''; @@ -57,7 +59,8 @@ $link_data = ''; function reg_link_data( $data_field_name ) { global $link_data; - $x = urlencode(trim(str_replace( array( '|', '~' ), '', stripslashes($GLOBALS[$data_field_name])))); + $value = ( $_REQUEST[$data_field_name] ) ? $_REQUEST[$data_field_name] : $GLOBALS[$data_field_name]; + $x = urlencode(trim(str_replace( array( '|', '~' ), '', stripslashes($value)))); if( $x != '' ) $link_data .= '&'.$data_field_name.'='.$x; } @@ -67,8 +70,9 @@ $form_data = ''; function reg_pass_data( $data_field_name, $value = '' ) { global $link_data, $form_data ; + $val = ( $_REQUEST[$data_field_name] ) ? $_REQUEST[$data_field_name] : $GLOBALS[$data_field_name]; //extract( $_REQUEST ); - $x = stripslashes(trim(str_replace( array( '|', '~' ), '', $GLOBALS[$data_field_name]))); + $x = stripslashes(trim(str_replace( array( '|', '~' ), '', $val))); if( $value != '' ) $x = $value; reg_link_data( $data_field_name ); @@ -216,11 +220,11 @@ if( $reg_data['need_attendees'] == 't' ) $attendees = $sep = ''; $numb_attendees = 0; $i = 0; - while( isset( $GLOBALS['attendee_'.(++$i).'_1'] ) ) - if( trim($GLOBALS['attendee_'.$i.'_1']) != '' ) // Note that extra _1 is a result of the java function used for this, deal with it. + while( isset( $_REQUEST['attendee_'.(++$i).'_1'] ) ) + if( trim($_REQUEST['attendee_'.$i.'_1']) != '' ) // Note that extra _1 is a result of the java function used for this, deal with it. { $attendee_found = TRUE; - $attendees .= $sep.$GLOBALS['attendee_'.$i.'_1']; + $attendees .= $sep.$_REQUEST['attendee_'.$i.'_1']; $sep = ', '; $numb_attendees++; } @@ -254,7 +258,7 @@ if( $Action == "Step3" ) if( !isset($registrant) || ($registrant = ($registrant-0)) == 0 ) { // Need to create registrant record - $user_trace_info = $REMOTE_ADDR." - ".date("m/d/Y H:i:s"); + $user_trace_info = $_SERVER['REMOTE_ADDR']." - ".date("m/d/Y H:i:s"); $sql = "INSERT INTO reg_req ( user_trace_info, date_entered, status ) VALUES @@ -614,7 +618,7 @@ if( !empty($registration) ) // Pass along attendee data $i = 0; - while( isset( $GLOBALS['attendee_'.(++$i).'_1'] ) ) + while( isset( $_REQUEST['attendee_'.(++$i).'_1'] ) ) if( $Action != 'Step2' ) reg_pass_data( 'attendee_'.$i.'_1' ); else @@ -754,7 +758,7 @@ $v["this_day_of_month"] = $date_array["mday"]; $v["navigation"] = $nav; $v["form_data"] = $GLOBALS['form_data']; $v["link_data"] = $link_data; -$view_tags["reason"] = $reason; +$view_tags["reason"] = $reason; $v['have_reason'] = ( count($reason) > 0 ? 'YES' : 'NO' ); $v["problem"] = ""; $v["price_debug"] = ""; @@ -767,6 +771,7 @@ $v['rate_classes'] = $rate_classes; $v['rate_name'] = $rate_class_name; $v['base_secure_url'] = BASE_SECURE_URL; $v['base_url'] = SI_BASE_URL; +$v['old_url'] = 'https://ws0.gaslightmedia.com/cslewis'; // Get bulletin and terms/conditions @@ -1078,7 +1083,7 @@ case "Step3": case "Step4": - $user_trace_info = $REMOTE_ADDR." - ".date("m/d/Y H:i:s"); + $user_trace_info = $_SERVER['REMOTE_ADDR'] . " - ".date("m/d/Y H:i:s"); $v['state'] = $state; $v['country'] = $country; @@ -1229,7 +1234,7 @@ case "Step4": $r = authorize_net_aim( SI_AUTH_LOGIN, SI_AUTH_TRAN_KEY, SI_AUTH_TEST, SI_AUTH_SEND_CONF, SI_AUTH_MERCHANT_EMAIL, $total_charges, $ccnum, "$ccmonth/$ccyear", $cccode, '', $fname, $lname, $org, $addr1, $city, $state, $zip, $country, - $phone, $fax, $reg_req_id, $REMOTE_ADDR, '', + $phone, $fax, $reg_req_id, $_SERVER['REMOTE_ADDR'], '', $email, $reg_req_id, 'Registration - '.$reg_data['name'], $conf_header, $conf_footer ); @@ -1274,17 +1279,17 @@ case "Step4": // Send user back to form with error - echo ' - - - - - -

Processing.....

- If your browser does not forward to the next page in less than 10 seconds, click HERE; - - - '; + // echo ' + // + // + // + // + // + //

Processing.....

+ // If your browser does not forward to the next page in less than 10 seconds, click HERE; + // + // + // '; exit; } diff --git a/registrations/siteinfo.php b/registrations/siteinfo.php index de2817f..5a1145c 100644 --- a/registrations/siteinfo.php +++ b/registrations/siteinfo.php @@ -386,7 +386,7 @@ $si_cc_verify = array // Values are regex test strings for card type "Diner's Club" => "^30[0-5].{11}$|^3[68].{12}$" ); -$si_cc_verify = $si_cc_verify; // Backward compatibility +$GLOBALS['si_cc_verify'] = $si_cc_verify; // Backward compatibility define( "SI_CC_ACCEPTS", 7 ); // Cards the CVB accepts - Carefull with this one - It's a bitmap of the cars above -- 2.17.1