#!/usr/bin/perl
require "set.pl";
&getinput;
&printhead;
open(FILE, "config.dat"); $a = @config = <FILE>; close FILE; for ($i=0; $i<$a; $i++) { chomp($config[$i]); }
if (($in{password} eq "") || ($in{username} eq "")) {
&showlogin;
}
if (-e "$config[7]/$in{username}.verify") {
@USER = getfile("$config[7]/$in{username}.verify");
}
else { 
&showlogin;
}
if ($in{password} ne $USER[1]) {
&showlogin;
}
rename("$config[7]/$in{username}.verify","$config[7]/$in{username}");
if ($USER[5] ne "rudean") {
@F = getfile("$config[7]/$USER[5]");
$F[10] ++;
$F[3] += $config[17];
$F[14] += $config[17];
writefile("$config[7]/$USER[5]", @F);
$COUNT[1]+= $config[17];
}
if ($USER[6] ne "rudean") {
@F = getfile("$config[7]/$USER[6]");
$F[11] ++;
writefile("$config[7]/$USER[6]", @F);
}
if ($USER[7] ne "rudean") {
@F = getfile("$config[7]/$USER[7]");
$F[12] ++;
writefile("$config[7]/$USER[7]", @F);
}
if ($USER[8] ne "rudean") {
@F = getfile("$config[7]/$USER[8]");
$F[13] ++;
writefile("$config[7]/$USER[8]", @F);
}
@COUNT = getfile("count.txt");
$COUNT[0]++;
$COUNT[1]+= $config[13];
&writefile("count.txt", @COUNT);
$text=<<d00der;
<h1 align="center"><b><font size="3">Аккаунт
активирован!</font></b></h1><p align="center"><b>
Ваш аккаунт активирован. <A HREF="member.cgi">Зайти</A> на аккаунт.</b><p></p>
d00der
reptem($text);
sub showlogin {
$text=<<d00der;
<H1 align="center"><b><font size="3">Активизация аккаунта:</font></b></H1>
<FORM METHOD="POST" ACTION="activate.cgi">
<div align="center"><center><TABLE><TR><TD>Логин</TD>
<TD><INPUT TYPE=TEXT NAME="username"></TD></TR>
<TR><TD>Пароль</TD>
<TD><INPUT TYPE=PASSWORD NAME="password"></TD></TR>
<tr><TD></TD>
<TD><INPUT TYPE="Submit" NAME="Submit" VALUE="Активировать"></TD></TR>
</TABLE></center></div></FORM>
d00der
reptem($text);
}
sub reptem {
my($text) = @_;
open(TEMP, "html.txt");
@TE = <TEMP>;
close TEMP;
$temp = join('',@TE);
$temp =~ s/%PLACE%/$text/;
print "$temp";
exit;
}
