# cgi-bin/randomizer: return one line of a text file $file = $ENV{'QUERY_STRING'}; $curhost = $ENV{'HTTP_HOST'}; if (substr ($curhost,0,4) ne "www.") { $curhost = "www." . $curhost; } $curhost = lc $curhost; if ($curhost == "www.wintercamp.net") { $curhost = "www.wintercamp.com"; } $webroot = '/webs/daha/' . $curhost . '/www/'; print "Content-type:text/html\n\n"; $mail = cookie('email'); %month = (); $month{'Jan'} = "01"; $month{'Feb'} = "02"; $month{'Mar'} = "03"; $month{'Apr'} = "04"; $month{'May'} = "05"; $month{'Jun'} = "06"; $month{'Jul'} = "07"; $month{'Aug'} = "08"; $month{'Sep'} = "09"; $month{'Oct'} = "10"; $month{'Nov'} = "11"; $month{'Dec'} = "12"; print "\n"; print "\n"; print "Winter Camp Universe * Site Map\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $filename = $webroot . "speed/speedlist.txt"; open (INF, "$filename") || dienice; @speedlist = ; close(INF); $filename = $webroot . "speed/profiles.txt"; open (INF, "$filename") || dienice; @profiles = ; close(INF); @temp = stat $webroot . "stuff/trivia/quizlist.txt"; $default_time = $temp[9]; $user_profile = "default|default|$default_time||Y|N|1*2*3*4*5*6*7*8*9*10*11*12*13*14*17*20*21*22*23*25*27*28*29*30*31*32*35*37*41*42*44*49"; foreach $profiles (@profiles) { @temp = split(/\|/,$profiles); if ($temp[0] eq $mail) { $user_profile = $profiles; } } ($email, $name, $last_time, $last_date, $show_shared, $personal, $include) = split(/\|/,$user_profile); if ($mail gt "") { $new_time = time; chomp $new_time; $new_date = `date`; chomp $new_date; $newprofile = $email . "|" . $name . "|" . $new_time . "|" . $new_date . "|" . $show_shared . "|" . $personal . "|" . $include . "|"; $filename = $webroot . "speed/profiles.txt"; open (INF, "$filename") || dienice; @profiles = ; close(INF); @profileout = ""; $replace = "N"; foreach $profiles (@profiles) { chomp $profiles; @temp = split(/\|/,$profiles); if ($temp[0] eq $mail) { push (@profileout, $newprofile); $replace = "Y"; } else { push (@profileout, $profiles); } } if ($replace eq "N") { push (@profileout, $newprofile); } open (OUTF, ">$filename"); foreach $profileout (@profileout) { chomp $profileout; if ($profileout gt "") { print OUTF "$profileout\n"; } } close(OUTF); } %new = ""; @temp = split(/\*/,$include); foreach $temp (@temp) { $new{$temp} = 'Y'; } $found = "N"; if ($personal eq "Y") { $filename = $webroot . "speed/personal.txt"; open (INF, "$filename") || dienice; @ownlist = ; close(INF); foreach $ownlist (@ownlist) { ($pmail, @plist) = split(/\|/,$ownlist); if ($pmail eq $mail) { $temp = $ownlist; $found = "Y"; } } if ($found eq "Y") { ($pmail, @plist) = split(/\|/,$temp) } } print "
"; if ($personal eq "Y") { if ($found ne "Y") { print ""; } else { print '"; } } if ($mail gt "") { print ""; } else { print ""; } print '"; print ""; if ($show_shared eq "Y") { print '"; } print "
No PersonalsConfigureRegisterExit
"; print "\n"; print "\n"; sub dienice { my($errmsg) = @_; print "Error:$errmsg\n"; print "

hit it

"; exit; }