#!/usr/local/perl588/bin/perl # "Dansie Shopping Cart" $version = "3.64"; # A Perl Shopping Cart # By Dansie Website Design # Copyright © Dec 10, 1997-2008 # 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. # Script licensed to: Matt Puls # Script licensed for use on only one (1) of these domains: zeldawisdom.com # 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 license without refund, 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/local/perl588/bin/perl # 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 LICENSE WITHOUT ### ### REFUND, 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; } if ($ENV{'PATH'}) { $flock = 0; } $delimiter = "|"; $delimiter2 = "\\" . "$delimiter"; $product_delimiter = ','; $custom_description_delimiter = "::"; $merchant_security = 1; $old_multi_item_form = 0; $diagnostics = 0; $allow_htpasswd_write = 1; $allow_passwords_with_ssl_pl_check_draft = 0; $mod_perl_no_headers = 0; if ($mod_perl_no_headers) { use CGI qw(:standard); } $state_length = 25; $maxlength_name = 70; $maxlength_company = 70; $maxlength_address = 70; $maxlength_city = 70; $maxlength_zip = 20; $maxlength_country = 40; $maxlength_phone = 30; $maxlength_email = 50; $vars_variable_set = "$vars"; if (!$vars && $ENV{'OS'} !~ /Windows_NT/i && $ENV{'DOCUMENT_ROOT'} ) { $vars = "$0"; $vars =~ s/\\/\//g; $vars =~ /^(.+)(\/)(.+)$/; $vars = "$1/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") { $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; &header; 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 > 250) { if ( ($vars_variable_set) && (-d "$vars_variable_set") ) { &header; print "

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 { &header; print "

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. Also, upload the vars.dat file in ASCII format via FTP and not binary format. 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); ($trash,$temp) = split(/--\>/,"$host_vars[0]"); ($trash,$temp2) = split(/--\>/,"$default_master_vars[1]"); if ( $temp =~ /\n$/ ) { chop($temp); } if ( $temp2 =~ /\n$/ ) { chop($temp2); } if ( $temp =~ /^(http)(s)(.+)$/ ) { $temp = "$1$3"; if ( $temp eq "$temp2" ) { $do_not_use_master_hv1 = 1; } } $host_vars[0] = $default_master_vars[1] if (!$do_not_use_master_hv1); $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] = ""; ($trash,$temp) = split(/--\>/,"$database_vars[0]"); if ($temp) { $vars_path_temp = $vars; $vars_path_temp =~ s/(.+)(\/)(.+)/$1$2/g; if ( $temp !~ /^($vars_path_temp)/) { $database_vars[0] = ""; } } if ( $personal_vars[79-1] =~ /^(79 Referral ID -->)(.*)/ && $2 eq "" ) { foreach (@default_master_vars) { if ( $_ =~ /^(79 Referral ID -->)(.+)/ ) { $personal_vars[79-1] = "79 Referral ID -->$2"; last; } } } if ( $personal_vars[79-1] !~ /^(79 Referral ID -->)/ ) { foreach (@default_master_vars) { if ( $_ =~ /^(79 Referral ID -->)(.+)/ ) { $merchant_lacks_pv79 = "$2"; last; } } } } ($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 =~ /^(no_f_switch)($delimiter2)(.+)$/i ) { ($trash,$trash,$mailprog) = split(/$delimiter2/,$mailprog); $no_f_switch = 1; } if ( $mailprog =~ /^(socket)($delimiter2)(.+)$/i ) { ($trash,$socket_smtp_server,$socket_return_path) = split(/$delimiter2/,$mailprog); } elsif ( $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/lib/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 = "/usr/sbin/sendmail"; } ($trash,$date_command) = split(/-->/,shift(@host_vars)); if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && $FORM{'merchant'} ) { $date_command = "/bin/date"; } $temp = $date_command; while ($temp =~ / /) { chop($temp); } if (!-e "$temp") { $date_command = ""; } ($trash,$path1) = split(/-->/,shift(@host_vars)); $path1 =~ s/\\/\//g; if (!$path1) { $path1_is_blank = 1; } if ( (!$path1) ) { $path1 = "$vars"; $a = ""; until ($a eq "/" || $path1 eq "") { $a = chop($path1); } $path1_backup = "$path1/carts"; $path1 = "$path1/temp"; if (-e "$path1_backup") { $path1 = "$path1_backup"; } } if (!$path1) { $path1 = "$script_root/carts"; } if ($path1 eq $script_root) { &diagnostics; &header; print "

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

"; &footer; } if ($path1 =~ /^http/i) { &diagnostics; &header; print "

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; &header; 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 writable (chmod it 777 on Unix).


"; print "You need to create a directory called \"temp\" in the same directory your vars.dat file is located in and set permissions as writable (chmod this directory \"temp\" 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_backup = "$path2/invoice.dat"; $path2 = "$path2/shopperid.dat"; if (-e "$path2_backup") { $path2 = "$path2_backup"; } } if ($path2 =~ /^http/i) { &diagnostics; &header; print "

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; &header; 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 writable (chmod it 777 on Unix).


"; print "The script needs to be able to keep a count file called \"shopperid.dat\" in order to assign shopper ID 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 \"shopperid.dat\" and upload it with your FTP program into the same directory that your vars.dat file is located in and set permissions on \"shopperid.dat\" as 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 || $tax_allow == 4 ) { @state = $state[0]; @tax = $tax[0]; } if ( !@tax ) { $tax[0] = 1; } while ( @state > @tax ) { push(@tax,"0"); } ($trash,$bgcolor) = split(/-->/,shift(@personal_vars)); if ( $bgcolor =~ /^#(\w\w)(\w\w)(\w\w)/ ) { $temp = "#$1$2$3"; $temp =~ s/O/0/gi; $bgcolor =~ s/^(#\w\w\w\w\w\w)/$temp/; $bgcolor =~ /^#(\w\w)(\w\w)(\w\w)/; $link_bg = "#$1$2$3"; $red = hex("$1"); $green = hex("$2"); $blue = hex("$3"); $average_color = int ( ( $red + $green + $blue ) / 3 ); if ( $average_color > (255/2) ) { $link_font = "#000000"; } else { $link_font = "#FFFFFF"; } } else { $link_bg = "#FFFFFF"; $link_font = "#000000" } ($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)); if ( !$FORM{merchant} ) { $email_content_type =~ s/\|/\n/g; } ($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; ($minimum_order,$maximum_order) = split(/\|/,$minimum_order); ($trash,$tracking_file) = split(/-->/,shift(@personal_vars)); while ($tracking_file =~ /(\n|\r|\s|\,)$/) { chop($tracking_file); } if ( $tracking_file =~ /\|/ ) { ($ssl_tracking_dir,$tracking_file) = split(/\|/,"$tracking_file"); } if ( $FORM{'merchant'} && $merchant_security && $tracking_file ) { $tracking_file2 = "$vars"; $a = ""; until ($a eq "/" || $tracking_file2 eq "") { $a = chop($tracking_file2); } if ( $tracking_file !~ /($tracking_file2)/i ) { $tracking_file = "$tracking_file2/tracking.dat"; } $tracking_file =~ s/\.\.\///g; $tracking_file =~ s/\.\.//g; } if ( ($tracking_file) && (-e "$tracking_file") && (!-w "$tracking_file") ) { &diagnostics; &header; 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_file\" and set permissions as 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 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); } ($sales_tax_state_verification,$assess_tax_on_shipping_or_billing_state) = split(/\|/,"$sales_tax_state_verification"); if ($assess_tax_on_shipping_or_billing_state ne "shipping" && $assess_tax_on_shipping_or_billing_state ne "billing") { $assess_tax_on_shipping_or_billing_state = "shipping"; } ($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; &header; 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)); if ($merchant_lacks_pv79) { $referral_id = $merchant_lacks_pv79; } while ($referral_id =~ /(\n|\r|\s|\,)$/) { chop($referral_id); } $referral_id =~ s/\s//g; ($trash,$pending_file) = split(/-->/,shift(@personal_vars)); while ($pending_file =~ /(\n|\r|\s|\,)$/) { chop($pending_file); } if ( $FORM{'merchant'} && $merchant_security && $pending_file ) { $pending_file2 = "$vars"; $a = ""; until ($a eq "/" || $pending_file2 eq "") { $a = chop($pending_file2); } if ( $pending_file !~ /($pending_file2)/i ) { $pending_file = "$pending_file2/tracking.dat"; } $pending_file =~ s/\.\.\///g; $pending_file =~ s/\.\.//g; } if ( ($pending_file) && (-e "$pending_file") && (!-w "$pending_file") ) { &diagnostics; &header; print "

Congratulations! You've successfully uploaded the Dansie Shopping Cart and chmoded the permissions 755 or better, but you forgot to create your pending.dat file at this location: \"$pending_file\" and set permissions as 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 #80 of the ReadMe. Create this file and upload it with your FTP program and set permissions on it as writable (chmod 777 on Unix). If you do not wish to use this feature, then leave PV#80 in your vars.dat file blank.

"; &footer; } ($trash,$aux_processor2_payment_option) = split(/-->/,shift(@personal_vars)); while ($aux_processor2_payment_option =~ /(\n|\r|\s|\,)$/) { chop($aux_processor2_payment_option); } ($trash,$suppress_address_in_customer_email_receipt) = split(/-->/,shift(@personal_vars)); while ($suppress_address_in_customer_email_receipt =~ /(\n|\r|\s)$/) { chop($suppress_address_in_customer_email_receipt); } ($trash,$billing_address_only_for_credit_cards) = split(/-->/,shift(@personal_vars)); while ($billing_address_only_for_credit_cards =~ /(\n|\r|\s)$/) { chop($billing_address_only_for_credit_cards); } ($trash,$temp) = split(/-->/,shift(@personal_vars)); while ($temp =~ /(\n|\r|\s|\,)$/) { chop($temp); } if ( $trash !~ /^(84)/ || $temp eq "1" ) { $shipping_roundup = 1; } elsif ( $temp eq "2" ) { $shipping_roundup = 1; $shipping_roundup2 = 1; } ($trash,$remove_button_status) = split(/-->/,shift(@personal_vars)); while ($remove_button_status =~ /(\n|\r|\s|\,)$/) { chop($remove_button_status); } if ( $trash !~ /^(85)/ ) { $remove_button_status = 1; } if ($remove_button_status == 2) { $change_remove_buttons = "side_by_side"; } else { $change_remove_buttons = "stacked"; } ($trash,$require_tos_agreement) = split(/-->/,shift(@personal_vars)); while ($require_tos_agreement =~ /(\n|\r|\s|\,)$/) { chop($require_tos_agreement); } if ($require_tos_agreement && !$lang[177]) { $lang[177] = 'I have read and agree to be bound by the Refund Policy and Terms of Service Agreement.'; } if ($require_tos_agreement && !$lang[178]) { $lang[178] = 'Customer has read and agreed to be bound by the Refund Policy and Terms of Service Agreement as set forth in:|http://www.YourName.com/'; } if ($require_tos_agreement && !$lang[179]) { $lang[179] = 'Sorry, you must first read and agree to be bound by the Refund Policy and Terms of Service Agreement before you can place an order. After you have read it, click the back button in your browser and checkmark the checkbox.'; } ($trash,$doctype) = split(/-->/,shift(@personal_vars)); while ($doctype =~ /(\n|\r|\s|\,)$/) { chop($doctype); } $doctype .= "\n"; ($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; &header; print "

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)); ($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 !~ /(.+)(\@)(.+)(\.)(.+)/) ) { &header; print "

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,$ssl_logo_url) = split(/-->/,shift(@cambist_vars)); while ($ssl_logo_url =~ /(\n|\r|\s)$/) { chop($ssl_logo_url); } ($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; &header; print "

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)); ($trash,$temp) = split(/-->/,shift(@database_vars)); @all_searchable_fields = split (/\,/,$temp); if ( $temp !~ /\,/ && $temp !~ /\d/ ) { @all_searchable_fields = (); } 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`; } chomp($date); if ( eval "require(\"timezone.lib\");" ) { $date = change_timezone($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"; $verisign_telecheck_url = "https://payflowlink.verisign.com/payflowlink.cfm"; $i_check = "https://paybycheck.com/payment.pl"; $i_check = "https://paybycheck.com/"; $ValidCheck = "https://www.ValidCheck.com/PayWizard.asp"; $ValidCheck = "https://www.validpay.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"; $use_zipcode_fields = 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"; } } if ( $FORM{'merchant'} ) { $correct_sales_tax_location_back_link = "$path3?look\|$FORM{'merchant'}"; } else { $correct_sales_tax_location_back_link = "$path3"; } $MerchantApprovedURL = "$path3?$unique_MAU"; $MerchantApprovedURL_aux_processor = "$path3?". "aux_processor" . "$unique_MAU"; $MerchantApprovedURL_aux_processor2 = "$path3?". "aux_processor2" . "$unique_MAU"; $MerchantUnApprovedURL = "$path3?failure"; if ( $FORM{'purpose2'} eq "check_transfer" ) { $MerchantApprovedURL = "$path3" . "?check$unique_MAU"; } if ($FORM{'merchant'}) { $MerchantApprovedURL .= "&" . "merchant=$FORM{'merchant'}"; $MerchantApprovedURL_aux_processor .= "&" . "merchant=$FORM{'merchant'}"; $MerchantApprovedURL_aux_processor2 .= "&" . "merchant=$FORM{'merchant'}"; $MerchantUnApprovedURL .= "&" . "merchant=$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; 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"; } $custom_description_currency_symbol_feature = 1; $all_different_passwords = 0; if ( $diagnostics ) { $temp = ""; foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $temp .= "$name = $value
"; } $lang[114] = "REQUEST_METHOD: $ENV{'REQUEST_METHOD'}
QUERY_STRING: $ENV{'QUERY_STRING'}
POST:
$temp
" . "$lang[114]"; } if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && (!$FORM{'merchant'}) && ($path3 eq "http://www.dansie.net/cgi-bin/scripts/cart.pl") ) { if ( $ENV{'HTTP_REFERER'} =~ /^(http:\/\/dansie\.net)/i ) { $special_security_message = ""; } if ( $ENV{'HTTP_REFERER'} =~ /^(http:\/\/www\.dansie\.net)/i ) { $special_security_message = ""; } if ( $ENV{'HTTP_REFERER'} =~ /^(http:\/\/dansiecart\.com)/i ) { $special_security_message = ""; } if ( $ENV{'HTTP_REFERER'} =~ /^(http:\/\/www\.dansiecart\.com)/i ) { $special_security_message = ""; } if ( $ENV{'HTTP_REFERER'} =~ /^(https:\/\/dansie\.securesites\.com)/i ) { $special_security_message = ""; } if ($special_security_message) { $lang[114] = "
This Demo Cart will allow you to POST any item and price to it so you may run tests with HTML forms that you create. However, the cart has a security feature where you can prevent people from posting to your cart from other than the domains you specifically authorize. See Personal Variable #66 in the ReadMe for details.
"; } } $browser_os_info = "$ENV{'HTTP_USER_AGENT'}"; $browser_os_info =~ s/([^\w|\d|\.])//gi; $email_log="$vars"; $a=""; until ($a eq "/" || $email_log eq "") { $a=chop($email_log); } $email_log1 = "$email_log" . "/email_log.txt"; $email_log2 = "$email_log" . "/email_log.dat"; if (-e "$email_log2") { $email_log = "$email_log2"; } else { $email_log = "$email_log1"; } $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" ) { &header; print "$doctype$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 ( $ENV{'QUERY_STRING'} =~ /^db$query_separator/i ) { ($trash,$FORM{'db'},$FORM{'category'},$trash,$trash,$trash,$trash,$FORM{'merchant'},) = split(/$query_separator/,$ENV{'QUERY_STRING'}); if ( $FORM{'category'} eq "All%20Items" ) { $FORM{'category'} = ""; } &database3; exit; } if ( $FORM{'file'} || $FORM{'search_categories'} ) { $FORM{'db'} = "$FORM{'file'}"; $FORM{'category'} = "$FORM{'search_categories'}"; &database3; exit; } if ( $FORM{'db'} ) { &database3; exit; } if ( $ENV{'QUERY_STRING'} =~ /^db=/i ) { &database3; exit; } if ( ($FORM{'add'}) || ($FORM{'add2'}) || ($FORM{'ADD'}) || ($FORM{'Add'}) || ($FORM{'purpose'} eq "add") || ($FORM{'purpose'} eq "ADD") ) { if ( ($ENV{'HTTP_HOST'} eq "www.dansie.net") && ($FORM{'name'} =~ /(piece of crap)/i) ) { $FORM{'name'} = "This is a Demo Cart that will allow you to post anything to it for testing purposes."; $FORM{'custom1'} = "This Demo Cart will allow you to POST any item and price to it so you may run tests with HTML forms that you create. However, the cart has a security feature where you can prevent people from posting to your cart from other than the domains you specifically authorize. See Personal Variable #66 in the ReadMe for details."; } 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; $adding_new_item_to_basket = 1; &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"); $untainted2 = &untaint("$path1/$ENV{'REMOTE_HOST'}$browser_os_info$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 ( $ip_or_cookie != 2 ) { use File::Copy; copy("$untainted","$untainted2"); } 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 ( $lang[35] && $FORM{'purpose'} eq "$lang[35]" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie) ) { &cookie_failure; } &get_shoppers_items; if (!$shopper_id) { &list_items; exit; } $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 ( $lang[38] && $FORM{'purpose'} eq "$lang[38]" ) { if (!&GetCookies("$cookie_name2") && ($ip_or_cookie) ) { &cookie_failure; } &get_shoppers_items; if (!$shopper_id) { &list_items; exit; } $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) ) { if (!$shopper_id) { &check_cookie; } &check_tax; if ($paper_font_color) { &paper_font_color; } &header; $purpose_temp = "$lang[1]"; $purpose_temp_title = "$purpose_temp"; $purpose_temp_title =~ s/<([^>]|\n)*>//g; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "$doctype$biz_temp - $purpose_temp_title\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
"; } print "
$lang[1]
"; $purchase_method2 = "$lang[26]"; &show_invoice; &address_table; print "
"; print "$lang[10] \n"; print " \"$payable\"" if ($payable); print "
\n\n"; print "$lang[11]

"; print "$add1
"; print "$add2
"; print "$add3
"; print "$add4
" if ( $add4 ); print "\n\n
$guarantee
\n\n"; print "
$lang[12] $add5
"; print"$myemail[0]
"; print "
"; &print_button; print "
$lang[111]

"; print "
Dansie Shopping Cart http://www.dansie.net
"; print ""; exit; } if ( ($FORM{'purpose'} eq "credit") || ($FORM{'purpose'} eq "aux_processor") || ($FORM{'purpose'} eq "aux_processor2") || ($FORM{'purpose'} eq "check_transfer") ) { &get_shoppers_items; if (!$shopper_id) { &check_cookie; } if (!$shopper_id) { &list_items; exit; } &check_tax; 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]"; } if ( $FORM{'purpose'} eq "aux_processor2" ) { $purpose_temp = "$lang[165]"; } &header; $purpose_temp_title = $purpose_temp; $purpose_temp_title =~ s/<([^>]|\n)*>//g; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; print "$doctype$biz_temp - $purpose_temp_title\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
"; } print "
$purpose_temp
"; print "
$lang[15]
\n"; if ($billing_address_only_for_credit_cards) { print "
$lang[172]
\n"; } print "
\n"; &get_shipping_cookie; &print_ship_address; if (!$billing_address_only_for_credit_cards) { $show_copy_button = 1; &print_ship_address2; } &comments if($comments); &tos_agreement if ($require_tos_agreement); 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"; } if ( $FORM{'purpose'} eq "aux_processor2" ) { print "\n"; } print ""; print "
$lang[111]

"; print "
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" ) || ( $FORM{'purpose2'} eq "aux_processor2" ) ) { &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"; } ©_shipping_info_to_billing_info; $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'}$delimiter$FORM{'confirm_email'}$delimiter$FORM{'confirm_email2'}\n"; $untainted = &untaint("$path1/$shopper_id$ext"); open(CART,">$untainted"); foreach $item (@items) { print CART "$item"; } close CART; if ($ip_or_cookie) { &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'}",'confirm_email',"$FORM{'confirm_email'}",'confirm_email2',"$FORM{'confirm_email2'}"); } $required_fields = &required_fields; $required_fields2 = &required_fields2; if ( $FORM{'purpose'} eq "ship_info" ) { $purpose_temp = "$lang[14]"; } if ( $FORM{'purpose2'} eq "credit" ) { $purpose_temp = "$lang[14]"; } if ( $FORM{'purpose2'} eq "check_transfer" ) { $purpose_temp = "$lang[71]"; } if ( $FORM{'purpose2'} eq "aux_processor" ) { $purpose_temp = "$lang[154]"; } if ( $FORM{'purpose2'} eq "aux_processor2" ) { $purpose_temp = "$lang[165]"; } if ( !$required_fields || !$required_fields2 || $no_valid_email_address || $no_valid_email_address2 || ($require_tos_agreement && !$FORM{tos_agreement}) ) { $purpose_temp_title = $purpose_temp; $purpose_temp_title =~ s/<([^>]|\n)*>//g; $biz_temp = "$bizname"; $biz_temp =~ s/<([^>]|\n)*>//g; &header; print "$doctype$biz_temp - $purpose_temp_title\n$meta_tag\n"; print ""; print "
$lang[114]
"; if ( $show_bizname ) { print "
$bizname
"; } if ( $image ) { print "
"; } print "
\n"; print "$lang[20]
$lang[21]\n" if(!$require_tos_agreement || $FORM{tos_agreement}); if ($no_valid_email_address || $no_valid_email_address2) { print "
$lang[166]\n"; } elsif ($email_not_confirmed) { print "
$lang[175]\n"; } elsif ($require_tos_agreement && !$FORM{tos_agreement}) { $lang[179] =~ s/http:\/\/www.YourName\.com\//$path4/g if($path4); print "
$lang[179]\n"; } print "

\n"; print "
$lang[111]

"; print "
Dansie Shopping Cart http://www.dansie.net
"; exit; } &deny_email_domains; &sales_tax_state_verification; if ($pending_file) { $purchase_method2 = "$lang[152] - $purpose_temp"; $tracking_file = "$pending_file"; if ( $items[1] !~ /^Shipping address info goes here later/ ) { &order_tracking; } } if ( $FORM{'purpose2'} eq "check_transfer" ) { if ( $option4 =~ /^(http)/i ) { $path5 = "$option4". '?' . "check"; } elsif ( $option4 =~ /^(signio)/i ) { $path5 = "$signio_echeck_url"; } elsif ( $option4 =~ /^(telecheck)/i ) { $path5 = "$verisign_telecheck_url"; $MerchantID = "$i_check_id"; } elsif ( $option4 =~ /(chexpedite)/i ) { $path5 = "$option4"; $MerchantID = "$i_check_id"; } else { &prepare_and_send_pending_order_notice; &i_check; } } &calculate_fulltotal; if ( ($minimum_order) && ($subtotal_original_for_minimum_order < $minimum_order) ) { &list_items; exit; } if ( ($maximum_order) && ($subtotal_original_for_minimum_order > $maximum_order) ) { &list_items; exit; } if ($total <= 0) { print "Location: $MerchantApprovedURL\n\n"; exit; } if ( ( ($path5 =~ /(html)$/) || ($path5 =~ /(htm)$/) ) && ( ($path5 !~ /(\.pl)/) && ($path5 !~ /(\.cgi)/) ) ) { } $processor_path = "$vars"; $a = ""; until ($a eq "/" || $processor_path eq "") { $a = chop($processor_path); } if ( $FORM{'purpose2'} eq "aux_processor" ) { ($path5,$MerchantID,$temp_exchange_rate) = split(/\|/,"$aux_processor_payment_option"); if ($temp_exchange_rate) { $MerchantID .= "\|$temp_exchange_rate"; } $MerchantApprovedURL = "$MerchantApprovedURL_aux_processor"; if (-e "$processor_path/$aux_processor_payment_option") { $processor_path = "$processor_path/$aux_processor_payment_option"; &custom_processor; } else { &cambist_or_authorize_net_names; } } if ( $FORM{'purpose2'} eq "aux_processor2" ) { ($path5,$MerchantID,$temp_exchange_rate) = split(/\|/,"$aux_processor2_payment_option"); if ($temp_exchange_rate) { $MerchantID .= "\|$temp_exchange_rate"; } $MerchantApprovedURL = "$MerchantApprovedURL_aux_processor2"; if (-e "$processor_path/$aux_processor2_payment_option") { $processor_path = "$processor_path/$aux_processor2_payment_option"; &custom_processor; } else { &cambist_or_authorize_net_names; } } if ( $FORM{'purpose2'} ne "aux_processor" && $FORM{'purpose2'} ne "aux_processor2" ) { if ( (-e "$processor_path/processor.dat") && ( $FORM{'purpose2'} ne "check_transfer" )) { $processor_path = "$processor_path/processor.dat"; &custom_processor; } else { &cambist_or_authorize_net_names; } } if ($bizname_backup) { $biz_temp = "$bizname_backup"; } else { $biz_temp = "$bizname"; } $biz_temp =~ s/<([^>]|\n)*>//g; &header; print "$doctype$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"; } print "
$lang[114]
"; if ( $show_bizname ) { print "
$biz_temp
"; } if ( $image ) { print "
"; } print "
$purpose_temp

"; print "
$lang[16]

"; if ( !$processor_post_method ) { $processor_post_method = "POST"; } print "
\n\n\n
\n"; &pass_standard_secure_variables; &pass_ssl_variables; &pass_shipping_secure_variables; print "\n"; print "
\n\n\n
\n"; if (!$force_no_script) { print "\n\n"; } print "
$lang[111]

"; print "
Dansie Shopping Cart http://www.dansie.net
"; print "\n"; print "