Файл: EasyHost v2.0/system/htdocs/admin/init.pl
Строк: 28
<?php
print "Pragma: no-cachen";
print "Cache-control: no-cachen";
my $login = undef;
if (length($system->cookie('admin')) == 15)
{
$login = $system->login($system->cookie('admin'));
}
elsif ($system->env('REQUEST_METHOD') eq 'POST')
{
$system->error('The password field is required') if (!$system->param('password'));
$system->error('The password you entered is incorrect') if ($system->param('password') ne $system->service->password);
my $temp = undef;
my @idset = ('0'..'9','a'..'z','A'..'Z');
srand(time);
for (my $i = 1; $i <= 15; $i++)
{
$temp .= $idset[int(rand($#idset + 1))];
}
$system->db->do('INSERT INTO logins VALUES (?,?,?,?,NOW())',undef,$temp,'0',$system->env('REMOTE_ADDR'),'/');
$system->set_cookie('admin',$temp);
$system->redirect;
}
else
{
$system->service->login;
}
?>