#!/usr/bin/perl # "Dansie Shopping Cart" $version = "3.14"; # A Perl Shopping Cart # By Dansie Website Design # Copyright © Dec 10, 1997 # www.dansie.net # cart@dansie.net # May not be used without purchasing a license. Do not attempt to run this # script on a site other than which it was licensed for. # Modification of this script other than: # 1. Adjusting the perl path in the first line above. # 2. Or setting the $vars variable below. # May void your right to technical support and subject you to legal action. # In some cases the first line above may need to be set to: #!/usr/local/bin/perl # Or: #!/usr/bin/perl5 # Set this $vars variable to the system path location of your vars.dat file if this # script can't auto detect it's location or if you wish to rename or relocate # the vars.dat file. See section 7 in the ReadMe for details. # http://www.dansie.net/cart_readme.html $vars = ""; ##################################################################### ### END OF ALL VARIABLES. DO NOT ATTEMPT TO RUN THIS SCRIPT ON A ### ### SITE OTHER THAN WHICH IT WAS LICENSED FOR. DO NOT MODIFY THE ### ### SCRIPT EXCEPT FOR THE $vars VARIABLE OR PERL PATH ABOVE. ### ### MODIFYING THE SCRIPT MAY TERMINATE YOUR RIGHT TO TECHNICAL ### ### SUPPORT AND SUBJECT YOU TO LEGAL ACTION. ### ##################################################################### if ( (!$vars) && ($ENV{'REMOTE_ADDR'} eq "127.0.0.1") ) { $vars = "C:/Dansie/Dansie_Cart/cgi-bin/vars.dat"; } $flock = 1; if (!$ENV{'DOCUMENT_ROOT'}) { $flock = 0; } $delimiter = "|"; $delimiter2 = "\\" . "$delimiter"; $merchant_security = 1; $vars_variable_set = "$vars"; if (!$vars && $ENV{'OS'} !~ /Windows_NT/i && $ENV{'DOCUMENT_ROOT'} ) { $vars = `pwd`; chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; if (!-e"$vars") { $script_root = $ENV{'SCRIPT_NAME'}; $script_root2 = "$ENV{'DOCUMENT_ROOT'}$ENV{'SCRIPT_NAME'}"; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $script_root = "$ENV{'DOCUMENT_ROOT'}$script_root"; $vars = "$script_root/vars.dat"; } if (!-e"$vars") { $script_root = $ENV{'SCRIPT_FILENAME'}; $script_root2 = $ENV{'SCRIPT_FILENAME'}; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } } if (!$vars && $ENV{'OS'} =~ /Windows_NT/i ) { if ($ENV{'PATH_TRANSLATED'}) { $script_root = $ENV{'PATH_TRANSLATED'}; $script_root2 = $ENV{'PATH_TRANSLATED'}; } if ($ENV{'DOCUMENT_ROOT'}) { $temp = "$ENV{'DOCUMENT_ROOT'}"; while ($temp =~ /[\\|\/]$/) { chop($temp); } if (!-e "$temp$ENV{'SCRIPT_NAME'}") { $a = ""; until ($a eq "/" || $a eq "\\" || $temp eq "") { $a = chop($temp); } } $script_root = "$temp$ENV{'SCRIPT_NAME'}"; $script_root2 = "$temp$ENV{'SCRIPT_NAME'}"; } $script_root =~ s/\\/\//g; $script_root2 =~ s/\\/\//g; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } if ( ((!-e "$vars") || (!$vars)) && (!$ENV{'OS'}) ) { if ($ENV{'DOCUMENT_ROOT'}) { $vars = `pwd`; } chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; } if ((!-e "$vars") && !$ENV{'DOCUMENT_ROOT'} && !$ENV{'OS'} ) { $script_root = "$ENV{'PATH'}"; while ( $script_root =~ /;/ ) { chop($script_root); } $script_root .= "$ENV{'SCRIPT_NAME'}"; $script_root2 = "$script_root"; $script_root =~ s/\\/\//g; $script_root2 =~ s/\\/\//g; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } if ( ( (!-e "$vars") || (!$vars) ) && (!$ENV{'OS'}) ) { $vars = `pwd`; chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; } if ( ((!-e "$script_root2") && (!-e "$vars")) || (( $script_root2 !~ /cart/i ) && (!-e "$vars")) ) { if (!$script_root2) { $script_root2 = "$vars"; $a = ""; until ($a eq "/" || $script_root2 eq "") { $a = chop($script_root2); } } &diagnostics; print "Content-type: text/html\n\n"; print "

Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but the cart script can't auto detect it's system path at: \"$script_root2\" because your host has unusual environment variables.


"; print "
"; print "Ways to determine your system paths:
"; print "
"; &footer; } &cant_find_vars; $br_sub = "kd9f3"; if ( $ENV{'CONTENT_TYPE'} !~ /multipart\/form\-data/i ) { &parse_form_data; } &merchant; if ( $version !~ /(Mall Version)/ ) { $FORM{'merchant'} = ""; } open(VARS,"$vars"); if ($flock) { flock(VARS, 2); } @vars = ; if ($flock) { flock(VARS, 8); } close(VARS); if ( $vars[0] =~ /Location:/ ) { &redirect_mall_merchant; } foreach $line (@vars) { chop($line); if ($line =~ /\n$/) { chop($line); } if ($line =~ /\r$/) { chop($line); } if ($line =~ /\s$/) { chop($line); } $line =~ s/(.+)(-->)( )(.+)/$1$2$4/; $line =~ s/'/`/g; $line =~ s/\\`/'/g; } while ( $vars_variable_set =~ /\/$/ ) { chop($vars_variable_set); } $vars_size = @vars; if ($vars_size < 90 || $vars_size > 200) { if ( ($vars_variable_set) && (-d "$vars_variable_set") ) { print "Content-type: text/html\n\n

Dansie Shopping Cart configuration warning!
If you want to define the \$vars variable near the top of the cart.pl script, make sure that the system path you set ends with \"vars.dat\".
Example:
$vars_variable_set/vars.dat

"; &diagnostics; &footer; } else { print "Content-type: text/html\n\n

Dansie Shopping Cart configuration warning!
Your vars.dat file appears to be corrupt. Check to make sure that you only have one line break per variable line. No more and no less. You can get a new vars.dat file in the latest ReadMe package.

"; &diagnostics; &footer; } } $n = 0; $n2 = 0; $vn = 0; foreach $line (@vars) { if (!$skip_to_next_section) { if ( ($line =~ /^\#\#\#/) ) { push(@vars2,"$line"); $n2++; $vn = 0; } elsif ( ($line =~ /-->/) ) { $line =~ /^(\d{1,2})(\D)(.*)/; $line_number = $1; if ($vars[$n+1] =~ /-->/) { $vars[$n+1] =~ /^(\d{1,2})(\D)(.*)/; $next_line_number = $1; $missing_line_breaks = ($next_line_number - ($line_number + 1) ); } $line_number2 = $line_number + 1; if ($line =~ /($line_number)(.*)(-->)(.*)($line_number2)(.*)(-->)(.*)/) { $line = "$1$2$3$4"; $line2 = "$5$6$7$8"; } push(@vars2,"$line"); $n2++; $vn++; if ($line2) { push(@vars2,"$line2"); $n2++; $vn++; $line2 = ""; $missing_line_breaks--; } if ($missing_line_breaks) { for($i=0;$i<$missing_line_breaks;$i++) { push(@vars2,""); $n2++; $vn++; } } } else { if ($n2>0) { $vars2[$n2-1] = "$vars2[$n2-1] $line"; if (!$line) { $skip_to_next_section = 1; } } } } elsif ($line =~ /^\#\#\#/) { $skip_to_next_section = 0; push(@vars2,"$line"); $n2++; $vn = 0; } $n++; } (@vars) = (@vars2); $a = ""; shift(@vars); until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@host_vars,$a); } } $a = ""; until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@personal_vars,$a); } } $a = ""; until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@cambist_vars,$a); } } $a = ""; until ( $a =~ /^\#\#\#/ ) { $a = shift(@vars); if ( $a !~ /^\#\#\#/ ) { push(@database_vars,$a); } } if ( ($host_vars[0] !~ /http/i) && ($host_vars[0] !~ /https/i) ) { @host_vars = ("$host_vars[4]","$host_vars[5]","$host_vars[6]","$host_vars[8]","$host_vars[9]","$host_vars[0]","$host_vars[1]","$host_vars[2]","$host_vars[3]","$host_vars[10]","$host_vars[7]"); } if ( $FORM{'merchant'} && $merchant_security ) { open(VARS,"$default_master_vars"); if ($flock) { flock(VARS, 2); } @default_master_vars = ; if ($flock) { flock(VARS, 8); } close(VARS); $host_vars[0] = $default_master_vars[1]; $host_vars[5] = $default_master_vars[6]; $host_vars[6] = $default_master_vars[7]; while ($host_vars[0] =~ /(\n|\r|\s)$/) { chop($host_vars[0]); } while ($host_vars[5] =~ /(\n|\r|\s)$/) { chop($host_vars[5]); } while ($host_vars[6] =~ /(\n|\r|\s)$/) { chop($host_vars[6]); } $host_vars[7] = ""; $host_vars[8] = ""; $host_vars[9] = ""; $personal_vars[22] = "3"; $database_vars[0] = ""; } ($trash,$path3) = split(/-->/,shift(@host_vars)); if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $path3 = "http://www.dansie.net/cgi-bin/scripts/cart.pl"; } ($trash,$path4) = split(/-->/,shift(@host_vars)); if ( $path4 !~ /\/{2}(.+)\/{1}/ ) { $path4 = "$path4/"; } ($trash,$base_img_url) = split(/-->/,shift(@host_vars)); $base_img_url =~ s/(.*)(\/)$/$1/; ($trash,$image) = split(/-->/,shift(@host_vars)); ($trash,$wp) = split(/-->/,shift(@host_vars)); ($trash,$mailprog) = split(/-->/,shift(@host_vars)); if ( $mailprog =~ /$delimiter2/ ) { ($mailprog,$blat_server) = split(/$delimiter2/,$mailprog); $blat_server = " -server " . "$blat_server"; } if (!$mailprog) { @common_sendmail_paths = ("/usr/sbin/sendmail", "/usr/lib/sendmail", "/usr/bin/sendmail", "/bin/sendmail", "/var/qmail/bin/qmail-inject", "/usr/home/stormer/bin/sendmail", "/bin/cgimail", "C:/winnt/system32/windmail.exe", "C:/winnt/system32/blat.exe", "c:/windmail/windmail.exe", 'C:\httpd\windmail\windmail.exe', 'C:\httpd\Blat\Blat.exe'); foreach (@common_sendmail_paths) { if (-e "$_") { $mailprog = "$_"; last; } } } if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $mailprog = "/bin/sendmail"; } ($trash,$date_command) = split(/-->/,shift(@host_vars)); if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $date_command = "/bin/date"; } ($trash,$path1) = split(/-->/,shift(@host_vars)); $path1 =~ s/\\/\//g; if ( (!$path1) ) { $path1 = "$vars"; $a = ""; until ($a eq "/" || $path1 eq "") { $a = chop($path1); } $path1 = "$path1/carts"; } if (!$path1) { $path1 = "$script_root/carts"; } if ($path1 eq $script_root) { &diagnostics; print "Content-type: text/html\n\n

Dansie Shopping Cart configuration warning!
Your \"carts\" directory is the same as the directory your cart.pl script is in!
May I suggest \"$path1/carts\" as the directory for Host Variable #8 ?
Please see the ReadMe about Host Variable #8.

"; &footer; } if ($path1 =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n

Dansie Shopping Cart configuration message:
Please leave Host Variable #8 in your vars.dat file blank.

"; &footer; } if (!-e "$path1") { &diagnostics; $path1 = &untaint("$path1"); mkdir("$path1",0777); if ( $ENV{'OS'} !~ /Windows_NT/i ) { `chmod 777 $path1`; } } if ( (!-w "$path1") || (!-e "$path1") ) { &diagnostics; print "Content-type: text/html\n\n"; print "

Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your \"$path1\" directory and set permissions as globally writable (chmod it 777 on Unix).


"; print "You need to create a directory called \"carts\" in the same directory your vars.dat file is located in and set permissions as globally writable (chmod this directory \"carts\" 777 if you are on a Unix host).

"; &footer; } ($trash,$path2) = split(/-->/,shift(@host_vars)); $path2 =~ s/\\/\//g; if ( (!$path2) ) { $path2 = "$vars"; $a = ""; until ($a eq "/" || $path2 eq "") { $a = chop($path2); } $path2 = "$path2/invoice.dat"; } if ($path2 =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n

Dansie Shopping Cart configuration message:
Please leave Host Variable #9 in your vars.dat file blank.

"; &footer; } if (!-e "$path2") { &diagnostics; $path2 = &untaint("$path2"); open(FILE, ">$path2"); print FILE "0"; close(FILE); if ( $ENV{'OS'} !~ /Windows_NT/i ) { `chmod 777 $path2`; } } if ( (!-w "$path2") || (!-e "$path2") ) { &diagnostics; print "Content-type: text/html\n\n"; print "

Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your \"$path2\" file and set permissions as globally writable (chmod it 777 on Unix).


"; print "The script needs to be able to keep a count file called \"invoice.dat\" in order to assign invoice numbers to your customers. The default location for this is in the same directory your vars.dat file is located in. Create an empty file named \"invoice.dat\" and upload it with your FTP program into the same directory that your vars.dat file is located in and set permissions on \"invoice.dat\" as globally writable (chmod 777 on Unix).

"; &footer; } ($trash,$lang_path) = split(/-->/,shift(@host_vars)); $lang_path =~ s/\\/\//g; &find_lang; ($trash,$target_name) = split(/-->/,shift(@host_vars)); if (!$target_name) { $target_name = ""; } ($trash,$ssl_target_page) = split(/-->/,shift(@host_vars)); while ( $ssl_target_page =~ /\s$/ ) { chop($ssl_target_page); } if ( $ssl_target_page && $ssl_target_page !~ /\/{2}(.+)\/{1}/ ) { $ssl_target_page = "$ssl_target_page/"; } if (!$ssl_target_page) { $ssl_target_page = "$path4"; } ($trash,$merchant_passwords) = split(/-->/,shift(@host_vars)); while ( $merchant_passwords =~ /\s$/ ) { chop($merchant_passwords); } ($trash,$login_ssl_url) = split(/-->/,shift(@host_vars)); while ( $login_ssl_url =~ /\s$/ ) { chop($login_ssl_url); } if (!$login_ssl_url) { $login_ssl_url = "$path3"; } ($trash,$customs) = split(/-->/,shift(@personal_vars)); ($trash,$myemail) = split(/-->/,shift(@personal_vars)); $myemail =~ s/ /\,/g; $myemail =~ s/\,\,/\,/g; $myemail =~ s/\,\,/\,/g; @myemail = split(/\,/,$myemail); ($trash,$ext) = split(/-->/,shift(@personal_vars)); $ext = "." . "$ext"; ($trash,$bizname) = split(/-->/,shift(@personal_vars)); ($trash,$payable) = split(/-->/,shift(@personal_vars)); ($trash,$guarantee) = split(/-->/,shift(@personal_vars)); ($trash,$add1) = split(/-->/,shift(@personal_vars)); ($trash,$add2) = split(/-->/,shift(@personal_vars)); ($trash,$add3) = split(/-->/,shift(@personal_vars)); ($trash,$add4) = split(/-->/,shift(@personal_vars)); ($trash,$add5) = split(/-->/,shift(@personal_vars)); ($trash,$tax_allow) = split(/-->/,shift(@personal_vars)); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @state = split(/\,/,$temp); if (!$state[0]) { $state[0] = "Calif"; } ($trash,$temp) = split(/-->/,shift(@personal_vars)); $temp =~ s/\%//g; @tax = split(/\,/,$temp); if ( $tax_allow == 2 ) { @state = $state[0]; @tax = $tax[0]; } if ( !$tax[0] ) { $tax[0] = 1; } while ( @state > @tax ) { push(@tax,"0"); } ($trash,$bgcolor) = split(/-->/,shift(@personal_vars)); ($trash,$font2) = split(/-->/,shift(@personal_vars)); ($trash,$font_face2) = split(/-->/,shift(@personal_vars)); ($trash,$font_size2) = split(/-->/,shift(@personal_vars)); ($trash,$font1) = split(/-->/,shift(@personal_vars)); ($trash,$font_face1) = split(/-->/,shift(@personal_vars)); ($trash,$font_size1) = split(/-->/,shift(@personal_vars)); ($trash,$img_borders) = split(/-->/,shift(@personal_vars)); ($trash,$expire) = split(/-->/,shift(@personal_vars)); if (!$expire) { $expire = "1"; } ($trash,$option1) = split(/-->/,shift(@personal_vars)); ($trash,$option2) = split(/-->/,shift(@personal_vars)); ($trash,$option3) = split(/-->/,shift(@personal_vars)); ($trash,$ship_allow) = split(/-->/,shift(@personal_vars)); ($trash,$show_ship) = split(/-->/,shift(@personal_vars)); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @method = split(/\,/,$temp); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @method_init_price = split(/\,/,$temp); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @method_price = split(/\,/,$temp); ($trash,$wt) = split(/-->/,shift(@personal_vars)); ($trash,$map_domain) = split(/-->/,shift(@personal_vars)); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @shipping_locations = split(/\,/,$temp); ($trash,$temp) = split(/-->/,shift(@personal_vars)); @shipping_via_amount = split(/$delimiter2/,$temp); ($trash,$symbol) = split(/-->/,shift(@personal_vars)); if ($symbol =~ /$delimiter2/) { ($symbol,$decimals,$currency_sep) = split(/$delimiter2/,$symbol); } else { if (!$decimals) { $decimals = "2"; } if (!$currency_sep) { $currency_sep = ","; } } if (!$symbol) { $symbol = "\$"; } if ($symbol =~ /\n$/) { chop($symbol); } if ($decimals =~ /\n$/) { chop($decimals); } if ($currency_sep =~ /\n$/) { chop($currency_sep); } if ($decimals < 0) { $decimals = 0; } $decimals2 = $decimals; $decimals = '%9.' . "$decimals" . 'f'; ($trash,$customer_mail) = split(/-->/,shift(@personal_vars)); if (!$customer_mail) { $customer_mail = 0; } ($trash,$address_table_bgcolor) = split(/-->/,shift(@personal_vars)); if (!$address_table_bgcolor) { $address_table_bgcolor = "#FFFFFF"; } ($trash,$ip_or_cookie) = split(/-->/,shift(@personal_vars)); ($trash,$borders2) = split(/-->/,shift(@personal_vars)); if ($borders2<1) { $borders2 = 0; } ($trash,$table_width) = split(/-->/,shift(@personal_vars)); if (!$table_width) { $table_width = "90\%"; } if ( $table_width < 400 && $table_width !~ /\%/ ) { $table_width = $table_width . "\%"; } ($trash,$option4) = split(/-->/,shift(@personal_vars)); if ($option4 =~ /$delimiter2/ ) { ($option4,$icheck_currency) = split(/$delimiter2/,$option4); } if ( @personal_vars < 1 ) { $use_state = 1; } else { ($trash,$use_state) = split(/-->/,shift(@personal_vars)); } if ( @personal_vars < 1 ) { $show_bizname = 1; } else { ($trash,$show_bizname) = split(/-->/,shift(@personal_vars)); } ($trash,$option5) = split(/-->/,shift(@personal_vars)); if ( $symbol ne "\\") { $option5 =~ s/($symbol)//; } ($trash,$comments) = split(/-->/,shift(@personal_vars)); ($trash,$reqired_field_prefs) = split(/-->/,shift(@personal_vars)); ($trash,$force_no_script) = split(/-->/,shift(@personal_vars)); ($trash,$add_and_redirect) = split(/-->/,shift(@personal_vars)); ($trash,$i_check_id) = split(/-->/,shift(@personal_vars)); if ($i_check_id =~ /$delimiter2/ ) { ($i_check_id,$exchange_rate) = split(/$delimiter2/,$i_check_id); } ($trash,$check_wp) = split(/-->/,shift(@personal_vars)); if (!$check_wp) { $check_wp = "$address_table_bgcolor"; } ($trash,$webstore_discount) = split(/-->/,shift(@personal_vars)); ($trash,$signature) = split(/-->/,shift(@personal_vars)); if ( $signature eq "default" ) { $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; $signature = "$biz_temp\|" . "$ssl_target_page" . "\|$myemail[0]"; } ($trash,$paper_font_color) = split(/-->/,shift(@personal_vars)); if ( $paper_font_color =~ /$delimiter2/ ) { ($paper_font_color,$paper_wp) = split(/$delimiter2/,$paper_font_color); } ($trash,$vars_security) = split(/-->/,shift(@personal_vars)); ($trash,$meta_tag) = split(/-->/,shift(@personal_vars)); $meta_temp = "$meta_tag"; while ( $meta_temp ) { $a = chop($meta_temp); if ($a =~ /"/) { $meta_temp2++; } } if ( ($meta_temp2 / 2) != ( int($meta_temp2 / 2) ) ) { $meta_tag = ""; } $meta_tag =~ s/\<\;/\/g; ($trash,$email_content_type) = split(/-->/,shift(@personal_vars)); ($trash,$email_encoding) = split(/-->/,shift(@personal_vars)); ($trash,$coupon_discount) = split(/-->/,shift(@personal_vars)); ($trash,$check_draft_image) = split(/-->/,shift(@personal_vars)); ($trash,$fix_int_quantity) = split(/-->/,shift(@personal_vars)); ($trash,$option6) = split(/-->/,shift(@personal_vars)); ($trash,$suppress_desc) = split(/-->/,shift(@personal_vars)); ($trash,$add_top_or_bottom) = split(/-->/,shift(@personal_vars)); ($trash,$invoice_prefix) = split(/-->/,shift(@personal_vars)); if ($invoice_prefix =~ / $/) { chop($invoice_prefix); } ($trash,$authorized_referrers) = split(/-->/,shift(@personal_vars)); while ($authorized_referrers =~ /(\n|\r|\s|\,)$/) { chop($authorized_referrers); } $authorized_referrers =~ s/\,\,/\,/; $authorized_referrers =~ s/^\,//; (@authorized_referrers) = split(/\,/,$authorized_referrers); foreach (@authorized_referrers) { $_ =~ s/^ //; $_ =~ s/ $//; $_ =~ s/^(www\.)//; } ($trash,$empty_entire_cart) = split(/-->/,shift(@personal_vars)); ($trash,$minimum_order) = split(/-->/,shift(@personal_vars)); while ($minimum_order =~ /(\n|\r|\s)$/) { chop($minimum_order); } $minimum_order =~ s/\$//g; ($trash,$tracking_dir) = split(/-->/,shift(@personal_vars)); while ($tracking_dir =~ /(\n|\r|\s|\,)$/) { chop($tracking_dir); } if ( $tracking_dir =~ /\|/ ) { ($ssl_tracking_dir,$tracking_dir) = split(/\|/,"$tracking_dir"); } if ( $FORM{'merchant'} && $merchant_security && $tracking_dir ) { $tracking_dir2 = "$vars"; $a = ""; until ($a eq "/" || $tracking_dir2 eq "") { $a = chop($tracking_dir2); } if ( $tracking_dir !~ /($tracking_dir2)/i ) { $tracking_dir = "$tracking_dir2/tracking.dat"; } $tracking_dir =~ s/\.\.\///g; $tracking_dir =~ s/\.\.//g; } if ( ($tracking_dir) && (-e "$tracking_dir") && (!-w "$tracking_dir") ) { &diagnostics; print "Content-type: text/html\n\n"; print "

Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your tracking.dat file at this location: \"$tracking_dir\" and set permissions as globally writable (chmod it 777 on Unix).


"; print "The script needs to be able to write to this file in order to do perform the order tracking feature described in Personal Variable #69 of the ReadMe. Create this file and upload it with your FTP program and set permissions on it as globally writable (chmod 777 on Unix). If you do not wish to use this feature, then leave PV#69 in your vars.dat file blank.

"; &footer; } if ( $FORM{'merchant'} ) { $ssl_tracking_dir = ""; } ($trash,$use_company_name_field) = split(/-->/,shift(@personal_vars)); while ($use_company_name_field =~ /(\n|\r|\s|\,)$/) { chop($use_company_name_field); } ($trash,$aux_processor_payment_option) = split(/-->/,shift(@personal_vars)); while ($aux_processor_payment_option =~ /(\n|\r|\s|\,)$/) { chop($aux_processor_payment_option); } ($trash,$email_receipt_tables) = split(/-->/,shift(@personal_vars)); while ($email_receipt_tables =~ /(\n|\r|\s|\,)$/) { chop($email_receipt_tables); } (@email_receipt_tables) = split(/\|/,"$email_receipt_tables"); ($trash,$shipping_weight_total) = split(/-->/,shift(@personal_vars)); ($trash,$state_list) = split(/-->/,shift(@personal_vars)); ($trash,$country_list) = split(/-->/,shift(@personal_vars)); while ($country_list =~ /(\n|\r|\s|\,)$/) { chop($country_list); } ($trash,$sales_tax_state_verification) = split(/-->/,shift(@personal_vars)); while ($sales_tax_state_verification =~ /(\n|\r|\s|\,)$/) { chop($sales_tax_state_verification); } ($trash,$htpasswd) = split(/-->/,shift(@personal_vars)); while ($htpasswd =~ /(\n|\r|\s|\,)$/) { chop($htpasswd); } if ( ( $FORM{'merchant'} && !$merchant_security ) || ( !$FORM{'merchant'} && $merchant_security ) || ( !$FORM{'merchant'} && !$merchant_security ) ) { if ( $htpasswd && ( (!-w "$htpasswd") || (!-e "$htpasswd") ) ) { &diagnostics; print "Content-type: text/html\n\n"; print "

It appears you have set Personal Variable #77 so that you can have random passwords appended to to your .htpasswd file. Make sure to create your \"$htpasswd\" file and set writable permissions. For more details on this, see \"Sell Passwords\" in section 14 of the ReadMe.


"; &footer; } } else { $htpasswd = ""; } ($trash,$deny_email_domains) = split(/-->/,shift(@personal_vars)); while ($deny_email_domains =~ /(\n|\r|\s|\,)$/) { chop($deny_email_domains); } @deny_email_domains = split(/\,/,"$deny_email_domains"); ($trash,$referral_id) = split(/-->/,shift(@personal_vars)); while ($referral_id =~ /(\n|\r|\s|\,)$/) { chop($referral_id); } ($trash,$path5) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantID) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantFont) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantFontColor) = split(/-->/,shift(@cambist_vars)); ($trash,$MerchantBgrdColor) = split(/-->/,shift(@cambist_vars)); ($trash,$unique_MAU) = split(/-->/,shift(@cambist_vars)); if ($unique_MAU =~ /[^a-zA-Z0-9]/) { &diagnostics; print "Content-type: text/html\n\n

Dansie Shopping Cart configuration message:
Please see Secure Server Variable #6 in the ReadMe. Letters and numbers in SSV#6 only. No special characters of any kind.

"; &footer; } if (!$unique_MAU) { $unique_MAU = "unique_MAU"; } $unique_MAU =~ s/ //g; ($trash,$instant_trans) = split(/-->/,shift(@cambist_vars)); if ( $instant_trans eq "" ) { $instant_trans = "Your order will be shipped pending credit card approval."; } ($trash,$append_datafile) = split(/-->/,shift(@cambist_vars)); $append_datafile =~ s/\\/\//g; if ( $FORM{'merchant'} && $merchant_security && $append_datafile ) { $append_datafile2 = "$vars"; $a = ""; until ($a eq "/" || $append_datafile2 eq "") { $a = chop($append_datafile2); } if ( $append_datafile !~ /($append_datafile2)/i ) { $append_datafile = "$append_datafile2/orders.dat"; } $append_datafile =~ s/\.\.\///g; $append_datafile =~ s/\.\.//g; } if ( ($append_datafile) && ( $append_datafile !~ /\// ) ) { $append_datafile = "$script_root/$append_datafile"; } $temp_path = $append_datafile; if ( $temp_path =~ /(.+)(\s)(.+)/ ) { ($temp_path2,$temp_path) = split(/\s/,$temp_path); } if ( $temp_path =~ /(.+)(\|)(.+)/ ) { ($temp_path2,$temp_path) = split(/\|/,$temp_path); } $a = ""; until ($a eq "/" || $temp_path eq "") { $a = chop($temp_path); } ($trash,$card_types) = split(/-->/,shift(@cambist_vars)); ($trash,$pgp) = split(/-->/,shift(@cambist_vars)); ($trash,$email_cc_numbers) = split(/-->/,shift(@cambist_vars)); while ($email_cc_numbers =~ /\s$/) { chop($email_cc_numbers); } if ( !$email_cc_numbers && !$append_datafile ) { $email_cc_numbers = "$myemail[0]"; } ($trash,$ssl_frames) = split(/-->/,shift(@cambist_vars)); while ($ssl_frames =~ /\s$/) { chop($ssl_frames); } if (!$ssl_frames) { $ssl_target_top = "TARGET=\"_top\""; } ($trash,$pending_order) = split(/-->/,shift(@cambist_vars)); while ($pending_order =~ /\s$/) { chop($pending_order); } if ( ($pending_order) && ($pending_order !~ /(.+)(\@)(.+)(\.)(.+)/) ) { print "Content-type: text/html\n\n

Dansie Shopping Cart configuration warning!
See Secure Server Variable #13 in the ReadMe. Either put an email address in it or leave it blank.

"; &diagnostics; &footer; } ($trash,$database_dir) = split(/-->/,shift(@database_vars)); $database_dir =~ s/\\/\//g; if ( !$database_dir ) { $database_dir = "$vars"; $a = ""; until ($a eq "/" || $database_dir eq "") { $a = chop($database_dir); } } if (!$database_dir) { $database_dir = "$script_root"; } if ($database_dir =~ /^http/i) { &diagnostics; print "Content-type: text/html\n\n

Dansie Shopping Cart configuration message:
Please leave Database Variable #1 in your vars.dat file blank or set it to a system path. Do not put a URL in there. URLs start with either \"http://\" or \"https://\" and system path start with either \"/\" (Unix) or \"c:/\" (Windows NT).

"; &footer; } ($trash,$view_url) = split(/-->/,shift(@database_vars)); if (($view_url) && ($view_url !~ /http/i)) { $view_url = "$base_img_url" . "/" . "$view_url"; } ($trash,$separator) = split(/-->/,shift(@database_vars)); if (!$separator) { $separator = "|"; } if ( $separator eq '\t' || $separator =~ /tab/i ) { $separator = "t"; } $separator = "\\" . "$separator"; ($trash,$options_separator) = split(/-->/,shift(@database_vars)); if (!$options_separator) { $options_separator = "^"; } $options_separator = "\\" . "$options_separator"; if (!$query_separator) { $query_separator = "|"; } $query_separator = "\\" . "$query_separator"; $query_separator2 = $query_separator; $query_separator2 =~ s/^\\//; ($trash,$temp) = split(/-->/,shift(@database_vars)); ($item_align,$image_align,$desc_align,$price_align) = split(/\|/,"$temp"); if (!$item_align) { $item_align = "center"; } if (!$image_align) { $item_align = "center"; } if (!$desc_align) { $item_align = "left"; } if (!$price_align) { $item_align = "center"; } ($trash,$item_cat_pos) = split(/-->/,shift(@database_vars)); ($trash,$stock_pos) = split(/-->/,shift(@database_vars)); ($trash,$name_pos) = split(/-->/,shift(@database_vars)); ($trash,$description_pos) = split(/-->/,shift(@database_vars)); ($trash,$price_pos) = split(/-->/,shift(@database_vars)); ($trash,$sh_pos) = split(/-->/,shift(@database_vars)); ($trash,$image_pos) = split(/-->/,shift(@database_vars)); ($trash,$temp) = split(/-->/,shift(@database_vars)); @additionals = split (/\,/,$temp); ($trash,$image_statement) = split(/-->/,shift(@database_vars)); ($trash,$button) = split(/-->/,shift(@database_vars)); if (!$lang[148]) { $lang[148] = "$button"; } ($trash,$home) = split(/-->/,shift(@database_vars)); ($trash,$items_per_page) = split(/-->/,shift(@database_vars)); if (!$items_per_page) { $items_per_page = 10;} ($trash,$uniform_images) = split(/-->/,shift(@database_vars)); if ($uniform_images) { ($uni_width,$uni_height) = split(/\,/,$uniform_images); if ($uni_width) { $uni_width = "WIDTH=$uni_width"; } if ($uni_height) { $uni_height = "HEIGHT=$uni_height"; } } ($trash,$database_logo) = split(/-->/,shift(@database_vars)); ($trash,$db_select_alignment) = split(/-->/,shift(@database_vars)); if (!$db_select_alignment) { $db_select_alignment = "center"; } ($trash,$db_select_stack_or_across) = split(/-->/,shift(@database_vars)); if (!$db_select_stack_or_across) { $db_select_stack_or_across = "across"; } ($trash,$navigation_bar) = split(/-->/,shift(@database_vars)); if ( $navigation_bar =~ /\n$/ ) { chop($navigation_bar); } $navigation_bar =~ s/\\/\//g; if ( $navigation_bar && $navigation_bar !~ /\// ) { $temp_navigation_bar = "$vars"; $a = ""; until ($a eq "/" || $temp_navigation_bar eq "") { $a = chop($temp_navigation_bar); } $navigation_bar = "$temp_navigation_bar/$navigation_bar"; } ($trash,$database_return_url) = split(/-->/,shift(@database_vars)); ($trash,$navigation_bar_position) = split(/-->/,shift(@database_vars)); if (!$navigation_bar_position) { $navigation_bar_position = "left"; } ($trash,$db_version) = split(/-->/,shift(@database_vars)); ($trash,$db_next_link_method) = split(/-->/,shift(@database_vars)); ($trash,$navigation_bar2) = split(/-->/,shift(@database_vars)); if ( $navigation_bar2 =~ /\n$/ ) { chop($navigation_bar2); } $navigation_bar2 =~ s/\\/\//g; if ( $navigation_bar2 && $navigation_bar2 !~ /\// ) { $temp_navigation_bar2 = "$vars"; $a = ""; until ($a eq "/" || $temp_navigation_bar2 eq "") { $a = chop($temp_navigation_bar2); } $navigation_bar2 = "$temp_navigation_bar2/$navigation_bar2"; } ($trash,$database_button_location) = split(/-->/,shift(@database_vars)); if ( $ENV{'CONTENT_TYPE'} =~ /multipart\/form\-data/i ) { &parse_form_data2; } &diagnostics; if ( $date_command ) { $date_command =~ /(.+)/; $date_command = $1; if ( $date_command !~ /\%/ ) { $date = `$date_command +"%D %T %Z"`; } else { $date = `$date_command`; } if ( $date =~ /\n$/ ) { chop($date); } } else { &SetCookieExpDate2; $date = "$Cookie_Exp_Date"; } if ( $mailprog =~ /(blat\.exe)/i ) { $blat = 1; } if ( $mailprog =~ /(windmail\.exe)/i ) { $windmail = 1; } $signio_echeck_url = "https://payflowlink.signio.com/paylinks.dll"; $i_check = "https://paybycheck.com/payment.pl"; $i_check = "https://paybycheck.com/"; $ValidCheck = "https://www.ValidCheck.com/PayWizard.asp"; $i_checkApprovedURL = "$path3?icheck$unique_MAU"; if ($FORM{'merchant'}) { $i_checkApprovedURL .= "%26" . "merchant" . "%3D" . "$FORM{'merchant'}"; } if ( ($FORM{'return'}) && ($FORM{'return'} !~ /\/{2}(.+)\/{1}/) ) { $FORM{'return'} = "$FORM{'return'}/"; } $atemp = @additionals; if ( $customs < ($atemp+2) ) { $customs = $atemp+2; } if ($ship_allow == 2) { $show_ship = 0; } $borders = 0; $security = 0; $compat = "4.0"; $discount_sep = ":"; if (!$ENV{'REMOTE_HOST'}) { $ENV{'REMOTE_HOST'} = "$ENV{'REMOTE_ADDR'}"; } $mail_ext = "mail"; $cambist_book_transaction = 0; if ( $card_types =~ /book/i ) { $cambist_book_transaction = 1; } if ( $card_types =~ /AVSVerify/i ) { $cambist_AVSVerify = 1; } $use_zipcode_fields = 1; $shipping_roundup = 1; $quantity_digits = 5; $ns3bugtime = .0000115 * 10 * 0; $max_secure_field_array = 20; $max_secure_field_array += 19; if ($email_content_type =~ /(text\/html)/i) { $html_br = "
"; } if ( $FORM{'merchant'} ) { if ($ssl_target_page eq "$path4") { $cambist_back = "$path3?look\|$FORM{'merchant'}"; } else { $cambist_back = "$ssl_target_page"; } } else { if ($ssl_target_page eq "$path4") { $cambist_back = "$path3"; } else { $cambist_back = "$ssl_target_page"; } } $MerchantApprovedURL = "$path3?$unique_MAU"; $MerchantApprovedURL_aux_processor = "$path3?". "aux_processor" . "$unique_MAU"; $MerchantUnApprovedURL = "$path3?failure"; if ( $FORM{'purpose2'} eq "check_transfer" ) { $MerchantApprovedURL = "$path3" . "?check$unique_MAU"; } if ($FORM{'merchant'}) { $MerchantApprovedURL .= "$delimiter" . "merchant$delimiter$FORM{'merchant'}"; $MerchantApprovedURL_aux_processor .= "$delimiter" . "merchant$delimiter$FORM{'merchant'}"; $MerchantUnApprovedURL .= "$delimiter" . "merchant$delimiter$FORM{'merchant'}"; } $Cookie_Exp_Date = ''; $Cookie_Path = '/'; $Cookie_Domain = ''; $Secure_Cookie = '0'; @Cookie_Encode_Chars = ('\%', '\+', '\;', '\,', '\=', '\&', '\:\:', '\s'); %Cookie_Encode_Chars = ('\%', '%25', '\+', '%2B', '\;', '%3B', '\,', '%2C', '\=', '%3D', '\&', '%26', '\:\:', '%3A%3A', '\s', '+'); @Cookie_Decode_Chars = ('\+', '\%3A\%3A', '\%26', '\%3D', '\%2C', '\%3B', '\%2B', '\%25'); %Cookie_Decode_Chars = ('\+', ' ', '\%3A\%3A', '::', '\%26', '&', '\%3D', '=', '\%2C', ',', '\%3B', ';', '\%2B', '+', '\%25', '%'); $cookie_name2 = "shopper_id"; if ( $FORM{'merchant'} ) { $cookie_name2 = "$FORM{'merchant'}_$cookie_name2"; } $require_address = 1; $require_city = 1; $require_state = 1; $require_zip = 1; $require_country = 1; $state_length = 25; $change_remove_buttons = "side_by_side"; $change_remove_buttons = "stacked"; if ( ( $FORM{'return'} =~ /(.+)(\?)(.+)/ ) || ( (!$FORM{'return'}) && $path4 =~ /(.+)(\?)(.+)/ ) ) { $post_get_method = "METHOD=POST"; } else { $post_get_method = "METHOD=GET"; } if ($referral_id) { $referral_id_code = "cgi-bin/referral.pl?id=" . "$referral_id"; } $demo = 0; if ($demo) { if ( $FORM{'purpose'} eq "credit" || $FORM{'purpose'} eq "credit_phone" || $FORM{'purpose'} eq "check" || $FORM{'purpose'} eq "check_transfer" || $FORM{'purpose'} eq "cod" ) { print "Content-type: text/html\n\n"; print "$bizname - Dansie Shopping Cart DEMO\n$meta_tag\n"; print "
This is just a demo version
Order Dansie Shopping Cart
Email: cart\@dansie.net
"; exit; } } if (!$map_domain) { $temp = $ENV{'REMOTE_HOST'}; @numbers = split(/\./, $ENV{'REMOTE_HOST'}); $ip_number = pack("C4", @numbers); ($ENV{'REMOTE_HOST'}) = (gethostbyaddr($ip_number, 2))[0]; if (!$ENV{'REMOTE_HOST'}) { $ENV{'REMOTE_HOST'} = $temp; } } if ( ($db_version > 2) && ($FORM{'db'}) ) { &database3; exit; } if ( ($db_version > 2) && ($ENV{'QUERY_STRING'} =~ /^db=/i) ) { &database3; exit; } if ( $ENV{'QUERY_STRING'} =~ /^db$query_separator/i ) { &database; exit; } if ( $FORM{'search'} ) { &database; exit; } if ( $FORM{'file'} && !$FORM{'search_categories'} ) { &database; exit; } if ( $FORM{'search_categories'} ) { $ENV{'QUERY_STRING'} = "db$query_separator2$FORM{'file'}$query_separator2$FORM{'search_categories'}"; if ( $FORM{'merchant'} ) { $ENV{'QUERY_STRING'} .= "$query_separator2$query_separator2$query_separator2$query_separator2" . "$FORM{'merchant'}"; } $ENV{'REQUEST_METHOD'} = "get"; &database; exit; } if ( ($FORM{'add'}) || ($FORM{'add2'}) || ($FORM{'ADD'}) || ($FORM{'Add'}) || ($FORM{'purpose'} eq "add") || ($FORM{'purpose'} eq "ADD") ) { if ( $FORM{'redirect'} ) { $add_and_redirect = $FORM{'redirect'}; } if ( $FORM{'redirect'} eq "0.00" ) { $add_and_redirect = "0"; } if ( $FORM{'redirect'} eq "no" ) { $add_and_redirect = "0"; } &delete_old_carts; &fix_quantity; &get_shoppers_items; &authorized_referrers; if ( -e "$path1/$shopper_id$ext" ) { if ( ($ns3bugtime) && ((-M "$path1/$shopper_id$ext" ) < $ns3bugtime) ) { if($add_and_redirect) { &add_and_redirect; } &list_items; exit; } $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); $n = 0; foreach $item (@items) { if ( ($n == 2) && ( $add_top_or_bottom !~ /(bottom)/i ) ) { &add_new_item_to_cart; } print CART "$item"; $n++; } if ( ($n == 2) && ( $add_top_or_bottom !~ /(bottom)/i ) ) { &add_new_item_to_cart; } if ( $add_top_or_bottom =~ /(bottom)/i ) { &add_new_item_to_cart; } close CART; if($add_and_redirect) { &add_and_redirect; } &list_items; exit; } if ( !(-e "$path1/$shopper_id$ext" ) ) { if ($FORM{'referrer'}) { $FORM{'referrer'} .= " - "; } $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); print CART "$date$delimiter$FORM{'referrer'}$invoice_prefix$invoice\n"; print CART "Shipping address info goes here later\n"; &add_new_item_to_cart; close CART; if($add_and_redirect) { &add_and_redirect; } &list_items; exit; } exit; } if ( $FORM{'purpose'} eq "look" || $ENV{'QUERY_STRING'} =~ /^look/i || ( !$ENV{'QUERY_STRING'} && $ENV{'REQUEST_METHOD'} =~ /get/i ) ) { &list_items; exit; } if ( $FORM{'purpose'} eq "$lang[35]" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie == 1) ) { &cookie_failure; } &get_shoppers_items; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); $n = 0; foreach $item (@items) { if ( $n == $FORM{'item'} ) { &change_quantity; } else { print CART "$item"; } $n++; } close CART; if ( @items <= 3 && $FORM{'quantity'} == 0 ) { $untainted = &untaint("$path1/$shopper_id$ext"); unlink("$untainted"); } &list_items; exit; } if ( $FORM{'purpose'} eq "$lang[38]" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie == 1) ) { &cookie_failure; } &get_shoppers_items; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); $n = 0; foreach $item (@items) { unless ( $n == $FORM{'item'} ) { print CART "$item"; } $n++; } close CART; &list_items; exit; } if ( ($FORM{'purpose'} eq "check") && ($option3 == 1) ) { &check_cookie; &check_tax; if ($paper_font_color) { &paper_font_color; } print "Content-type: text/html\n\n"; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "$biz_temp - $lang[1]\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
\"$bizname\"
"; } print "
$lang[1]
"; $purchase_method2 = "$lang[26]"; &show_invoice; &address_table; print "
"; print "$lang[10] \"$payable\"
"; print "$lang[11]

"; print "$add1
"; print "$add2
"; print "$add3
"; print "$add4
" if ( $add4 ); print "\n\n
$guarantee
\n\n"; print "
$lang[12] $bizname
"; print "$add5
"; print"$myemail[0]
"; print "
"; &print_button; print "
$lang[111]
Dansie Shopping Cart http://www.dansie.net
"; print ""; exit; } if ( ($FORM{'purpose'} eq "credit") || ($FORM{'purpose'} eq "aux_processor") || ($FORM{'purpose'} eq "check_transfer") ) { if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && ($FORM{'merchant'} eq "dansiecart") && ( $FORM{'purpose'} eq "credit" ) ) { &non_post_secure_server; } &check_cookie; &check_tax; &get_shoppers_items; if ( $items[1] =~ /$delimiter2/ ) { ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9) = split(/$delimiter2/, $items[1]); } if ( $FORM{'purpose'} eq "credit" ) { $purpose_temp = "$lang[14]"; if ( $path5 !~ /paypal.com/ ) { $ssl_target_top = ""; } } if ( $FORM{'purpose'} eq "check_transfer" ) { $purpose_temp = "$lang[71]"; } if ( $FORM{'purpose'} eq "aux_processor" ) { $purpose_temp = "$lang[154]"; } print "Content-type: text/html\n\n"; $purpose_temp_title = $purpose_temp; $purpose_temp_title =~ s/<([^>]|\n)*>//g; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "$biz_temp - $purpose_temp_title\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
\"$bizname\"
"; } print "
$purpose_temp
"; print "
$lang[15]

"; &get_shipping_cookie; &print_ship_address; $show_copy_button = 1; &print_ship_address2; &comments if($comments); print "

"; if ( $lang[19] =~ /^http/i ) { print ""; } else { print ""; } print "
"; if ( $FORM{'purpose'} eq "check_transfer" ) { print "\n"; } if ( $FORM{'purpose'} eq "aux_processor" ) { print "\n"; } print ""; print "
$lang[111]
Dansie Shopping Cart http://www.dansie.net
"; print ""; exit; } if ( ( $FORM{'purpose'} eq "ship_info" && (!$FORM{'purpose2'}) ) || ( $FORM{'purpose2'} eq "check_transfer" ) || ( $FORM{'purpose2'} eq "aux_processor" ) ) { &get_shoppers_items; if ($comments) { chop($items[0]) if ( $items[0] =~ /\n$/ ); ($a,$b,$c,$d,$e,$f,$coupon_number) = split(/$delimiter2/,$items[0]); $items[0] = "$a$delimiter$b$delimiter$c$delimiter$d$delimiter$FORM{'comments'}$delimiter$f$delimiter$coupon_number\n"; } $items[1] = "$FORM{'name'}$delimiter$FORM{'company'}$delimiter$FORM{'address'}$delimiter$FORM{'city'}$delimiter$FORM{'state'}$delimiter$FORM{'zip'}$delimiter$FORM{'country'}$delimiter$FORM{'phone'}$delimiter$FORM{'email'}$delimiter$FORM{'name2'}$delimiter$FORM{'company2'}$delimiter$FORM{'address2'}$delimiter$FORM{'city2'}$delimiter$FORM{'state2'}$delimiter$FORM{'zip2'}$delimiter$FORM{'country2'}$delimiter$FORM{'phone2'}$delimiter$FORM{'email2'}\n"; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); foreach $item (@items) { print CART "$item"; } close CART; if ($ip_or_cookie == 1) { &SetCookieExpDate; &SetCompressedCookies('shipping_address','name',"$FORM{'name'}",'company',"$FORM{'company'}",'address',"$FORM{'address'}",'city',"$FORM{'city'}",'state',"$FORM{'state'}",'zip',"$FORM{'zip'}",'country',"$FORM{'country'}",'phone',"$FORM{'phone'}",'email',"$FORM{'email'}",'name2',"$FORM{'name2'}",'company2',"$FORM{'company2'}",'address2',"$FORM{'address2'}",'city2',"$FORM{'city2'}",'state2',"$FORM{'state2'}",'zip2',"$FORM{'zip2'}",'country2',"$FORM{'country2'}",'phone2',"$FORM{'phone2'}",'email2',"$FORM{'email2'}"); } $required_fields = &required_fields; $required_fields2 = &required_fields2; if ( $FORM{'purpose'} eq "credit" ) { $purpose_temp = "$lang[14]"; } if ( $FORM{'purpose'} eq "check_transfer" ) { $purpose_temp = "$lang[71]"; } if ( $FORM{'purpose'} eq "aux_processor" ) { $purpose_temp = "$lang[154]"; } if ( !$required_fields || !$required_fields2 ) { $purpose_temp_title = $purpose_temp; $purpose_temp_title =~ s/<([^>]|\n)*>//g; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "Content-type: text/html\n\n"; print "$biz_temp - $purpose_temp_title\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
\"$bizname\"
"; } print "
$lang[20]
$lang[21]

"; print "
$lang[111]
Dansie Shopping Cart http://www.dansie.net
"; exit; } &deny_email_domains; &sales_tax_state_verification; if ( $pending_order ) { $purchase_method = "$lang[152]"; &get_shoppers_items; $pending_order =~ s/ /\,/g; $pending_order =~ s/\,\,/\,/g; $pending_order =~ s/\,\,/\,/g; (@pending_order) = split(/\,/,"$pending_order"); foreach $myemail (@pending_order) { &send_email2('merchant'); } } if ( $FORM{'purpose2'} eq "check_transfer" ) { if ( $option4 =~ /^(http)/i ) { $path5 = "$option4". '?' . "check"; } elsif ( $option4 =~ /^(signio)/i ) { $path5 = "$signio_echeck_url"; } else { &i_check; } } &calculate_fulltotal; if ( ( ($path5 =~ /(html)$/) || ($path5 =~ /(htm)$/) ) && ( ($path5 !~ /(\.pl)/) && ($path5 !~ /(\.cgi)/) ) ) { } if ( $FORM{'purpose2'} eq "aux_processor" ) { if ( $aux_processor_payment_option !~ /\|/ ) { $path5 = "http://216.184.194.135/encrypt.cfm"; $MerchantID = "$aux_processor_payment_option"; } else { ($path5,$MerchantID) = split(/\|/,"$aux_processor_payment_option"); } $MerchantApprovedURL = "$MerchantApprovedURL_aux_processor"; &cambist_or_authorize_net_names; } if ( $FORM{'purpose2'} ne "aux_processor" ) { $processor_path = "$vars"; $a = ""; until ($a eq "/" || $processor_path eq "") { $a = chop($processor_path); } $processor_path = "$processor_path/processor.dat"; if (-e "$processor_path") { &custom_processor; } else { &cambist_or_authorize_net_names; } } if ( $path5 =~ /ematters.com.au/ ) { $invoice =~ s/ /\+/g; $temp_query_string = "?OpenForm&" . "$total" . "&" . "$invoice" . "&" . "[$MerchantApprovedURL"; print "Content-type: text/html\n\n"; print ""; exit; } if ( $path5 =~ /paypal.com/ ) { if ( $path5 !~ /\/$/ ) { $path5 .= "/"; } $temp_MerchantApprovedURL = "$MerchantApprovedURL"; $temp_MerchantApprovedURL =~ s/\?/\%3F/; $temp_myemail = "$MerchantID"; $temp_myemail =~ s/\@/\%40/; $temp_item_name = "$lang[158] $invoice"; $temp_item_name =~ s/ /\+/g; $temp_item_name =~ s/\#//g; $temp_query_string = "business=" . "$temp_myemail" . "&item_name=" . "$temp_item_name" . "&amount=" . "$total" . "&return=" . "$temp_MerchantApprovedURL"; print "Content-type: text/html\n\n"; print ""; exit; } $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "Content-type: text/html\n\n"; print "$biz_temp - $purpose_temp\n$meta_tag\n"; if (!$force_no_script) { print "\n\n"; } if (!$force_no_script) { print "\n"; } if (!$force_no_script) { print "\n"; } if (!$force_no_script) { print "\n"; } if ( !$processor_post_method ) { $processor_post_method = "POST"; } print "
\n\n\n
\n"; &pass_standard_secure_variables; &pass_ssl_variables; &pass_shipping_secure_variables; if (!$force_no_script) { print ""; } print "
\n\n\n
"; if (!$force_no_script) { print ""; } print ""; exit; } if ( ( $ENV{'QUERY_STRING'} =~ /^failure/ ) || ( ( $path5 =~ /www.aba.net.au/ ) && ( $ENV{'QUERY_STRING'} =~ /refused/i ) || ( $ENV{'QUERY_STRING'} =~ /timeout/i ) ) || ( ( $path5 =~ /www.1internetave.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(approve)(\=)(0)(.*)/ ) ) || ( ( $path5 =~ /commercepay\.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(MStatus\=Decline)(.*)/ || $ENV{'QUERY_STRING'} =~ /(.*)(MStatus\=failure)(.*)/ ) ) || ( ( $path5 =~ /(eplastic)$/ ) && ( $FORM{'accepted'} eq "NO" ) ) || ( ( $path5 =~ /(eplastic)$/ ) && ( $FORM{'accepted'} eq "YES" ) && ( $ENV{'HTTP_REFERER'} && $ENV{'HTTP_REFERER'} !~ /(https\:\/\/www\.e-plastic\.com)/ ) ) || ( ( $path5 =~ /authorize\.net/ ) && ( ($FORM{'RESPONSECODE'} eq "D") || ($FORM{'RESPONSECODE'} eq "R") || ($FORM{'RESPONSECODE'} eq "E") ) ) || ( ( $path5 =~ /secpay\.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(valid\=false)(.*)/ ) ) || ( ( $path5 =~ /signio\.com/ && $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) && ( $ENV{'QUERY_STRING'} =~ /(RESPMSG)/ ) && ( $ENV{'QUERY_STRING'} !~ /(.*)(RESPMSG\=Approved)(.*)/ ) ) || ( ( $path5 =~ /anacom\.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(approval\=)/i ) && ( $ENV{'QUERY_STRING'} !~ /(.*)(approval\=)(\d{1,})(.*)/i && $ENV{'QUERY_STRING'} !~ /(.*)(approval\=)(SimulatedApproval)(.*)/i ) ) ) { &check_duplicate_order2; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "Content-type: text/html\n\n"; print "$biz_temp - $lang[22]\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
\"$bizname\"
"; } print "
$lang[23]

"; print "
"; &get_shoppers_items; chop($items[0]); @info = split(/$delimiter2/, $items[0]); $tax = $info[2]; $ship_method = $info[3]; print "
"; print ""; print ""; print "$lang[24]
"; print "

"; if ( $lang[148] =~ /^http/i ) { print ""; } else { print ""; } print "

"; if ( !$ssl_frames ) { $path4 = "$ssl_target_page"; } &home; print "

\n"; print "
$lang[111]
Dansie Shopping Cart http://www.dansie.net
"; print "
"; print ""; exit; } if ( ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(check$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(icheck$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(ValidCheck$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(aux_processor$unique_MAU)/ ) || ( ( $path5 =~ /www.1internetave.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(approve)(\=)(1)(.*)/ ) ) || ( ( $path5 =~ /anacom\.com/i ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(approval\=)(\d{1,})(.*)/i || $ENV{'QUERY_STRING'} =~ /(.*)(approval\=)(SimulatedApproval)(.*)/i ) ) || ( ( $path5 =~ /bamart.com/ ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(Ecom_transaction_complete)(\=)(TRUE)(.*)/ ) ) ) { &check_duplicate_order2; if ($paper_font_color) { &paper_font_color; } if ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) { $purpose_temp = "$lang[14]
$instant_trans"; } if ( ( $ENV{'QUERY_STRING'} =~ /^(check$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(icheck$unique_MAU)/ ) || ( $ENV{'QUERY_STRING'} =~ /^(ValidCheck$unique_MAU)/ ) ) { $purpose_temp = "$lang[71]"; } if ( ( $ENV{'QUERY_STRING'} =~ /^(aux_processor$unique_MAU)/ ) ) { $purpose_temp = "$lang[154]"; } if ( ( $path5 =~ /anacom\.com/i ) && ( $ENV{'QUERY_STRING'} =~ /(.*)(approval\=)(\d{1,})(.*)/i || $ENV{'QUERY_STRING'} =~ /(.*)(approval\=)(SimulatedApproval)(.*)/i ) ) { $ENV{'QUERY_STRING'} = "$unique_MAU" . "$ENV{'QUERY_STRING'}"; } $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "Content-type: text/html\n\n"; print "\n"; print "$biz_temp - $lang[28]\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
\"$bizname\"
"; } print "
$purpose_temp
$lang[28]

"; print "
$lang[29]

"; $purchase_method2 = "$purpose_temp"; if ( $ENV{'QUERY_STRING'} =~ /^($unique_MAU)/ ) { $purchase_method2 = "$lang[14]"; } &order_tracking; $affiliate = 1; &show_invoice; if ( $items[1] =~ /$delimiter2/ ) { ($field1,$field2,$field3,$field4,$field5,$field6,$field7,$field8,$field9,$field10,$field11,$field12,$field13,$field14,$field15,$field16,$field17,$field18) = split(/$delimiter2/, $items[1]); } print "
$lang[30]

"; &print_ship_address; &print_ship_address2; &comments if($comments); print "
"; print "
\n\n $guarantee

\n\n"; print "$add1
"; print "$add2
"; print "$add3
"; print "$add4
" if ( $add4 ); print"
$lang[12] $bizname
"; print "$add5
"; print"$myemail[0]
"; print "
"; &print_button; &check_mailprog; print "
$lang[111]
Dansie Shopping Cart http://www.dansie.net
"; print "\n"; print "\n"; print "