Файл: EasyHost v2.0/system/htdocs/password/default.pl
Строк: 36
<?php
srand(time);
if ($system->param('username'))
{
$system->error('The username field contains invalid characters') if ($system->param('username') !~ /^[w-]+$/);
my $user = EasyHost::User->new($system->db->selectrow_array('SELECT id FROM users WHERE name = ?',undef,$system->param('username'))) || $system->error('The username you entered wasn't found in our database');
$user->notice('password','has forgotten their password');
}
elsif ($system->param('email'))
{
$system->error('The email address field contains invalid characters') if ($system->param('email') !~ /.+@[w-.]{4,}/);
my $count = 0;
my $select = $system->db->prepare('SELECT id FROM users WHERE email = ?');
$select->execute($system->param('email'));
while (my $user = EasyHost::User->new($select->fetchrow_array))
{
$count++;
$user->notice('password','has forgotten their password');
}
$select->finish;
$system->error('The email address you entered wasn't found in our database') if ($count == 0);
}
else
{
$system->error('You must enter either your username or email address to retrieve your password');
}
$system->redirect('finish');
?>