#!/usr/local/bin/perl #Copyright-2004 Oleg Yu. Novikov - All rights reserved. # GET INFO $getpath = "$ENV{'PATH_INFO'}"; $rootpath=$ENV{'DOCUMENT_ROOT'}; $UserAgent=$ENV{'HTTP_USER_AGENT'}; $RemHost=$ENV{'REMOTE_HOST'}; $RemAddress=$ENV{'REMOTE_ADDR'}; $QueryString=$ENV{'QUERY_STRING'}; # Define Variables $mailprog = '/usr/lib/sendmail'; $mymail = "ol_novik\@pushkin-town.net"; $notmodify=""; $lenwrd=length($RemHost); $lan_g=substr($RemHost,$lenwrd-2,2); if($lan_g eq "ru" || $lan_g eq "ua" || $lan_g eq "su" || $lan_g eq "kz" || $lan_g eq "ar" || $lan_g eq "by"){ $lang = "rus"; }else{ $lang = "eng"; } open(IN,"$rootpath/sufy/skins/".$lang."descript.txt"); $descript = ; close(IN); open(IN,"$rootpath/sufy/skins/".$lang."keywords.txt"); $keywords = ; close(IN); open(IN,"$rootpath/sufy/skins/".$lang."titul.txt"); $tituldat = ; close(IN); # SELECT INFO # Split the name-value pairs @pairs = split(/&/, $QueryString); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } $getpath =~ tr/+/ /; $getpath =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $getpath =~ s///g; $date = `/usr/bin/date`; chop($date); $dt = `date +"%d"`; chop($dt); $mn = `date +"%m"`; chop($mn); $yr = `date +"%y"`; chop($yr); $hr = `date +"%H"`; chop($hr); $mt = `date +"%M"`; chop($mt); $sk = `date +"%S"`; chop($sk); if ($mn eq "01") {$convmonth = "January"} elsif ($mn eq "02") {$convmonth = "February"} elsif ($mn eq "03") {$convmonth = "March"} elsif ($mn eq "04") {$convmonth = "April"} elsif ($mn eq "05") {$convmonth = "May"} elsif ($mn eq "06") {$convmonth = "June"} elsif ($mn eq "07") {$convmonth = "July"} elsif ($mn eq "08") {$convmonth = "August"} elsif ($mn eq "09") {$convmonth = "September"} elsif ($mn eq "10") {$convmonth = "October"} elsif ($mn eq "11") {$convmonth = "November"} elsif ($mn eq "12") {$convmonth = "December"} #------------------begin# if ($mn eq "01") {$convtmonth = "Jan"} elsif ($mn eq "02") {$convtmonth = "Feb"} elsif ($mn eq "03") {$convtmonth = "Mar"} elsif ($mn eq "04") {$convtmonth = "Apr"} elsif ($mn eq "05") {$convtmonth = "May"} elsif ($mn eq "06") {$convtmonth = "Jun"} elsif ($mn eq "07") {$convtmonth = "Jul"} elsif ($mn eq "08") {$convtmonth = "Aug"} elsif ($mn eq "09") {$convtmonth = "Sep"} elsif ($mn eq "10") {$convtmonth = "Oct"} elsif ($mn eq "11") {$convtmonth = "Nov"} elsif ($mn eq "12") {$convtmonth = "Dec"} $dwkf = `date +"%w"`; chop($dwkf); if($dwkf ne "6") { $dwke = $dwkf+1; }else{ $dwke = "0"; } if ($dwke eq "0") {$convteday = "Sun"} elsif ($dwke eq "1") {$convteday = "Mon"} elsif ($dwke eq "2") {$convteday = "Tue"} elsif ($dwke eq "3") {$convteday = "Wed"} elsif ($dwke eq "4") {$convteday = "Thu"} elsif ($dwke eq "5") {$convteday = "Fri"} elsif ($dwke eq "6") {$convteday = "Sat"} if($dwkf ne "0") { $dwm = $dwkf-1; }else{ $dwm = "6"; } if ($dwm eq "0") {$convtday = "Sun"} elsif ($dwm eq "1") {$convtday = "Mon"} elsif ($dwm eq "2") {$convtday = "Tue"} elsif ($dwm eq "3") {$convtday = "Wed"} elsif ($dwm eq "4") {$convtday = "Thu"} elsif ($dwm eq "5") {$convtday = "Fri"} elsif ($dwm eq "6") {$convtday = "Sat"} if($dt ne "31" && $dt ne "30"){ $dex=$dt+1; }else{ $dex="1"; } $dxlen=length($dex); if($dxlen<=1){ $dex="0".$dex; } $expiresdate="$convteday, "."$dex $convtmonth 20".$yr." 23:59:58 GMT"; if($dt ne "1"){ $dtm=$dt-1; }else{ $dtm="1"; } $dtlen=length($dtm); if($dtlen<=1){ $dtm="0".$dtm; } $modifieddate="$convtday, "."$dtm $convtmonth 20".$yr." ".$hr.":01:01 GMT"; #--------------------------------------------end--# $resdate = $convmonth." ".$dt.", 20".$yr; $restime = $hr.".".$mt.".".$sk; $res= "Date: ".$resdate." . Time: ".$restime; ###### LAST POSITION ######### &print_first; if ($lang eq "rus"){ print "

ÏÎÆÀËÓÉÑÒÀ, ÂÛÁÅÐÈÒÅ ßÇÛÊ
PLEASE, SELECT LANGUAGE

ÐÓÑÑÊÈÉ

ENGLISH

"; }else{ print "

PLEASE, SELECT LANGUAGE

ÏÎÆÀËÓÉÑÒÀ, ÂÛÁÅÐÈÒÅ ßÇÛÊ

RUSSIAN

ENGLISH

"; } &print_past; exit; ###################### E N D of S E L E C T I N G ######### ##################################### SUBS ################################ # # sub print_first { if($notmodify eq "on"){ print "Content-type: text/html; charset=windows-1251\n\n"; print "\n"; print "\n\n\n"; }else{ print "Last-Modified: $modifieddate\nContent-type: text/html; charset=windows-1251\n\n"; print "\n"; print "\n\n\n"; print "\n\n\n"; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "$tituldat\n"; open(IN,"$rootpath/sufy/skins/".$lang."1short.txt"); @session = ; close(IN); foreach $line (@session) { print $line; } } ########### sub print_past { open(IN,"$rootpath/sufy/skins/".$lang."2short.txt"); @session = ; close(IN); foreach $line (@session) { print $line; } } exit;