Файл: pass.php
Строк: 168
<?php
//error_reporting(2047|2048);
error_reporting(0);
include 'config.php';
class_exists('config') or die('Error load config class');
$config = new config(1, 1, 1);
$lang = $config->parse_lang() or die('Error parse lang file');
$config->start('pass', $lang['1056']);
if(!isset($_POST['id']) || !isset($_POST['mail'])){
if($config->vers == 'wml')
echo '<small>'.$lang['1020'].':</small><br/>'.
'<input type="text" name="id" maxlength="11" format="*N"/><br/>'.
'<small>'.$lang['1033'].':</small><br/>'.
'<input type="text" name="mail" maxlength="150"/><br/>'.
'<small><anchor>'.$lang['1028'].'<go href="pass.php" method="post">'.
'<postfield name="l" value="'.$config->lang.'"/>'.
'<postfield name="v" value="wml"/>'.
'<postfield name="id" value="$(id)"/>'.
'<postfield name="mail" value="$(mail)"/>'.
'</go></anchor><br/>'.
'<a href="index.php?l='.$config->lang.'&v=wml">'.$lang['1027'].'</a></small>';
else
if($config->vers == 'html')
echo '<form action="pass.php" method="post">'.
'<input type="hidden" name="l" value="'.$config->lang.'"/>'.
'<input type="hidden" name="v" value="html"/>'.
$lang['1020'].':<br/>'.
'<input type="text" name="id" maxlength="11"/><br/>'.
$lang['1033'].':<br/>'.
'<input type="text" name="mail" maxlength="150"/><br/>'.
'<input type="submit" value="'.$lang['1028'].'"/><br/>'.
'<a href="index.php?l='.$config->lang.'&v=html">'.$lang['1027'].'</a>'.
'</form>';
$config->finish(true);
}
$id = intval($_POST['id']);
$mail = trim($_POST['mail']);
$mail = strtolower($mail);
if(!$id || !$mail){
echo '<u>'.$lang['1025'].'</u><br/>'.
'<a href="pass.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1029'].'</a><br/>'.
'<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
$config->finish(true);
}
if(!$mysql = mysql_connect($config->mysql['host'], $config->mysql['user'], $config->mysql['pass'])){
if($config->vers == 'wml'){
print '<b>'.$lang['1014'].'! '.$lang['1010'].'</b><br/>';
}
else
if($config->vers == 'html'){
print '<font color="'.$config->color['error'].'">'.$lang['1014'].'! '.$lang['1010'].'</font><br/>';
}
print $lang['1015'].' MySQL: <u>'.mysql_error().'</u><br/>';
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
$config->finish(true);
}
if(!mysql_select_db($config->mysql['db'], $mysql)){
if($config->vers == 'wml'){
print '<b>'.$lang['1014'].'! '.$lang['1011'].'</b><br/>';
}
else
if($config->vers == 'html'){
print '<font color="'.$config->color['error'].'">'.$lang['1014'].'! '.$lang['1011'].'</font><br/>';
}
print $lang['1015'].' MySQL: <u>'.mysql_error().'</u><br/>';
print '<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish(true);
}
$q = mysql_query("SELECT `mail`, `pass` FROM `users` WHERE `id` = '$id';", $mysql);
$q = mysql_fetch_array($q);
if(!$q || $q['mail'] != $mail){
echo '<u>'.$lang['1025'].'</u><br/>'.
'<a href="pass.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1029'].'</a><br/>'.
'<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish(true);
}
$subj = $lang['1056'];
$subj = convert_cyr_string($subj, 'w', 'k');
$subj = base64_encode($subj);
$subj = '=?koi8-r?B?'.$subj.'?=';
$head = 'From: '.$config->site.' <'.$config->mail.'>'."n".
'Reply-To: <'.$config->mail.'>'."n".
'Content-Type: text/plain; charset=windows-1251'."n".
'MIME-Version: 1.0';
$mess = $lang['1057'].' '.$config->site."rn".
$lang['1021'].': '.$q['pass']."rn".
$lang['1049'].': http://'.$config->site.'/panel.php?id='.$id.'&ps='.$q['pass'];
mail($mail, $subj, $mess, $head);
echo $lang['1054'].' <u>'.$mail.'</u><br/>'.
'<a href="index.php?l='.$config->lang.'&v='.$config->vers.'">'.$lang['1003'].'</a>';
mysql_close($mysql); $config->finish();
?>