#!/usr/bin/perl ###################################################################### ################### UCJ Version 4.4.3 ################### ################### Copyright 1999-2003 ################### ################### by TRB Holdings Pty Ltd ################### ################### http://www.trbholdings.com ################### ################### All Modifications Prohibited ################### ###################################################################### $ucjpath = "/usr/home/admin/sites/www.hankshoneys.com/cgi-bin/ucj"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; if ($input{$name}) { $input{$name} = $input{$name}.",".$value; } else { $input{$name} = $value; } } print "Content-type: text/html\n\n"; chomp(@settings=`cat $ucjpath/protect/ucjdata/ucjdata`); $date = $settings[3]; $ucjdata = "$ucjpath/protect/ucjdata"; chomp(@settings=`cat $ucjdata/ucjwebmaster`); $trade_ratio = $settings[0]; $maxsignups = $settings[1]; $trade_type = $settings[2]; $autosignup = $settings[3]; $auto_icq = $settings[4]; $auto_url = $settings[5]; $auto_email = $settings[6]; $maxurllength=100; $trade_hourly=0; $trade_category1=""; $trade_category2=""; $trade_category3=""; $site_show="n"; $site_desc=""; $site_extra1=""; $site_extra2=""; $site_extra3=""; $site_extra4=""; $wm_ip=$ENV{'REMOTE_ADDR'}; chomp($wm_date=`$date '+%y%m%d-%H:%M:%S'`); if (($input{'submit'} eq 'Start Trading') and ($autosignup eq "on")) {&UpdateUser;} &PrintPage; sub PrintPage{ chomp(@wm=`cat $ucjdata/ucjwmpage`); for ($i=0;$i<=40;$i++) { print "$wm[$i]\n"; } chomp(@rules=`cat $ucjdata/ucjrules`); foreach $rule (@rules) { print "
Send all traffic to
';
print "$auto_url
ICQ Contact #'; print "$auto_icq
"; print 'Email Contact
';
print "$auto_email
';
print "Domain: $domain ";
print "Site Name: $site_title Data Successfully Entered ";
print "Send all traffic to $auto_url";
&WriteMembers;
exit;
}
sub ErrorHeader {
print " ERROR ";
}
sub ErrorFooter {
print " If you received this error because of a misentered value then hit the back button and try again. ";
print "Otherwise if there is another problem please contact me via $auto_icq to sort out a trade.";
print '';
exit;
}
sub Error1 {
&ErrorHeader;
print "The return url must be on the same domain as traffic is counted for the auto signup form.";
print "You may however request a manual trade.";
&ErrorFooter;
}
sub Error2 {
&ErrorHeader;
print "The return url does not appear to be valid. ";
&ErrorFooter;
}
sub Error3 {
&ErrorHeader;
print "The Domain $domain is Blacklisted. ";
&ErrorFooter;
}
sub Error4 {
&ErrorHeader;
print "The Domain $domain is Already Trading with Us. ";
&ErrorFooter;
}
sub Error5 {
&ErrorHeader;
print "The Maximum number of Unreviewed Submissions have been submitted.";
print "Please contact the webmaster directly for a trade.";
&ErrorFooter;
}
sub Error6 {
&ErrorHeader;
print "The URL You've entered is too long.";
print "Please contact the webmaster directly for a trade.";
&ErrorFooter;
}
";
print "Return URL: $trade_url
";
print "Email: $wm_email
";
print "ICQ Number: $wm_icq
";
print "ICQ Nick: $wm_nick
";
print "Webmaster: $wm_name
";
if ($domain ne $trade_urlc) {&Error1;}
if (length($trade_url) < 14) {&Error2;}
chomp (@blacklist=`cat $ucjdata/ucjblacklist`);
foreach $blacklist (@blacklist) {
if ($domain =~ m/$blacklist$/) { &Error3; }
}
chomp (@existing=`cat $ucjdata/ucjtrades1`);
foreach $existing (@existing) {
($existing) = split /\|/,$existing;
if ($domain eq $existing) {&Error4;}
}
chomp (@existing=`cat $ucjdata/ucjtrades1.new`);
foreach $existing (@existing) {
($existing) = split /\|/,$existing;
if ($domain eq $existing) {&Error4;}
}
$nnewmems=@existing;
if ($nnewmems >= $maxsignups) {&Error5;}
if (length($trade_url) > $maxurllength) {&Error6;}
print "