|
|
 |
Гостевая книга
#!/usr/bin/perl
######################################################
#
# m-guestbook ЧЕТУЙС 0.4 ПФ 24.08.2003
#
#
$version="m-guestbook v0.4";
require "th_guestbook.settings";
require "modules/a_records.pm";
require "modules/a_auth.pm";
record_init_structure ("$g_basedir", "sessions");
record_init_structure ("$g_basedir", "users");
$cod_file="cod.dat";
#####
# юФЕОЙЕ ДБООЩИ ЙЪ ЖПТНЩ
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {($name, $value) = split(/=/, $pair);$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s///g;$value =~ s/<([^>]|\n)*>//g;
$FORM{$name} = $value;}
$temp=$ENV{'QUERY_STRING'};@pairs=split(/&/,$temp);
foreach $item(@pairs) {($key,$content)=split (/=/,$item,2);$content=~tr/+/ /;
$content=~ s/%(..)/pack("c",hex($1))/ge;
$content =~ s///g;$content =~ s/<([^>]|\n)*>//g;
$FORM{$key}=$content; }
#
#####
print "Content-type:text/html\n\n";
$page=0;
$usercookie=0;
$tmp_action=$FORM{'action'};
@actionz=split("!",$tmp_action);
$action=$actionz[0];
$usercookie=$actionz[1];
$er=$actionz[2];
$approve=0;
$cod=$FORM{'cod'};
$userid=$FORM{'userid'};
if ($action eq "auth") {
$login=$FORM{'login'};;
$password=$FORM{'passwrd'};
($approve, %logged_user_info) = auth_firstlogin($login, $password);
$usercookie = auth_getkey($logged_user_info{id});
if (($usercookie eq "")||($usercookie eq "0")) {$usercookie="0";}
print <Processing...
processing... |