2022-06-11 11:32:31 +00:00
< ? php
require_once '_incl_data/mails.php' ;
2022-06-07 00:30:34 +03:00
$step = 1 ;
$error = '' ;
2022-06-11 11:32:31 +00:00
if ( isset ( $_GET [ 'login' ])) {
$_POST [ 'relogin' ] = $_GET [ 'login' ];
2022-06-07 00:30:34 +03:00
}
function GetRealIp ()
{
2022-06-11 11:32:31 +00:00
if ( ! empty ( $_SERVER [ 'HTTP_CLIENT_IP' ])) {
$ip = $_SERVER [ 'HTTP_CLIENT_IP' ];
} elseif ( ! empty ( $_SERVER [ 'HTTP_X_FORWARDED_FOR' ])) {
$ip = $_SERVER [ 'HTTP_X_FORWARDED_FOR' ];
} else {
$ip = $_SERVER [ 'REMOTE_ADDR' ];
}
return $ip ;
2022-06-07 00:30:34 +03:00
}
2022-06-11 11:32:31 +00:00
define ( 'IP' , GetRealIp ());
if ( isset ( $_POST [ 'relogin' ])) {
$_POST [ 'relogin' ] = htmlspecialchars ( $_POST [ 'relogin' ], null , 'cp1251' );
include ( '_incl_data/__config.php' );
define ( 'GAME' , true );
include ( '_incl_data/class/__db_connect.php' );
2022-06-07 00:30:34 +03:00
2022-06-11 11:32:31 +00:00
$usr = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string ( $_POST [ 'relogin' ]) . '" LIMIT 1' ));
if ( isset ( $usr [ 'id' ])) {
2022-06-07 00:30:34 +03:00
2022-06-11 11:32:31 +00:00
if ( $usr [ 'admin' ] == 0 && $usr [ 'banned' ] == 0 ) {
$step = 2 ;
if ( isset ( $_POST [ 'redate' ])) {
//Третий шаг
$lst_psw = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `repass` WHERE `uid` = "' . $usr [ 'id' ] . '" AND `time` > ' . ( time () - 24 * 60 * 60 ) . ' AND `type` = "1" LIMIT 1' ));
if ( isset ( $lst_psw [ 'id' ])) {
$error = 'Высылать пароль можно не более одного раза в сутки.' ;
} elseif ( str_replace ( '0' , '' , $_POST [ 'redate' ]) == str_replace ( '0' , '' , $usr [ 'bithday' ]) && ( $_POST [ 'reanswer' ] == $usr [ 'q1' ] || $usr [ 'q1' ] == '' )) {
$error = '<br><br><br>Пароль от персонажа "' . $usr [ 'login' ] . '" был успешно выслан на E-mail указанный при регистрации! <br><br><br>' ;
$re = mysql_fetch_array ( mysql_query ( 'SELECT * FROM `logs_auth` WHERE `uid` = "' . $usr [ 'id' ] . '" AND `type` = "0" AND `depass` != "" ORDER BY `id` DESC LIMIT 1' ));
if ( $u [ 'securetime' ] < $c [ 'securetime' ]) {
unset ( $re );
}
if ( ! isset ( $re [ 'id' ])) {
$sm = [ 'a' , 'b' , 'c' , 'd' , 'e' , 'f' , 'x' , 'd' , 'f' , 'X' , 'e' , 'ER' , 'XX' , 'X' ];
$re [ 'depass' ] = $sm [ rand ( 0 , 12 )] . rand ( 0 , 9 ) . $sm [ rand ( 0 , 12 )] . rand ( 0 , 9 ) . $sm [ rand ( 0 , 12 )] . rand ( 0 , 9 ) . $sm [ rand ( 0 , 12 )] . rand ( 0 , 9 ) . $sm [ rand ( 0 , 12 )] . rand ( 0 , 9 );
}
$title = 'Восстановление пароля от "' . $usr [ 'login' ] . '".' ;
$txt = 'Добрый день.<br>' ;
$txt .= 'С IP-адреса - <b>' . IP . '</b>, был запрошен пароль для вашего персонажа.<br>Если это не Вы, просто удалите это письмо.<br><br>' ;
$txt .= 'Ваш логин: <b>' . $usr [ 'login' ] . '</b><br>' ;
$txt .= 'Ваш пароль: ' . $re [ 'depass' ] . '<br><br>' ;
$txt .= 'Отвечать на данное письмо не нужно.<br><br>' ;
$txt .= 'С уважением,<br>' ;
$txt .= 'Администрация Бойцовского Клуба' ;
$mail = mails ( $usr [ 'mail' ], $txt , $title );
if ( $mail === 1 ) {
mysql_query ( 'UPDATE `users` SET `securetime` = "' . time () . '" , `allLock`="' . ( time () + 60 * 60 * 24 * 0 ) . '",`pass` = "' . mysql_real_escape_string ( md5 ( $re [ 'depass' ])) . '" WHERE `id` = "' . $usr [ 'id' ] . '" LIMIT 1' );
mysql_query ( 'INSERT INTO `repass` (`uid`,`ip`,`type`,`time`) VALUES ("' . $usr [ 'id' ] . '","' . mysql_real_escape_string ( IP ) . '","1","' . time () . '")' );
$step = 3 ;
} else {
$error = $mail ;
}
unset ( $mail );
} else {
$error = 'Неверный ответ на секретный вопрос или неверно указан день рождения.' ;
}
}
} else {
$error = 'Персонажу "' . $_POST [ 'relogin' ] . '" запрещена высылка пароля!' ;
}
} else {
$error = 'Логин "' . htmlspecialchars ( $_POST [ 'relogin' ], null , 'cp1251' ) . '" не найден в базе.' ;
}
}
2022-06-07 00:30:34 +03:00
?>
<!DOCTYPE html>
<html lang="ru-RU">
<head>
2022-06-11 11:32:31 +00:00
<meta charset="windows-1251"/>
<title>Восстановление пароля от персонажа Бойцовский Клуб</title>
<meta name="keywords"
content="бойцовский клуб игра, бойцовский клуб играть, игра бойцовский клуб, старый бойцовский Клуб, бойцовский клуб онлайн игра, бойцовский клуб браузерная игра, играть в бойцовский клуб, игра бк, бк игра, старый бк, играть в бк, бк онлайн игра, новый бк, Легендарный Бойцовский Клуб, легендарный бк, combats, комбатс, combats ru, combats com, OldBK, oldbk ru, oldbk com, олдбк, old bk, олд бк, mycombats, rebk, recombats, oldcombats, obk2">
<meta name="description"
content="На этой страничке игроки могут восстановить свой игровой пароль в браузерной игре Новый Бойцовский Клуб"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<link href="homepage/index.css" type="text/css" rel="stylesheet">
2022-06-07 00:30:34 +03:00
</head>
<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
2022-06-11 11:32:31 +00:00
<tr>
<td height="100" align="center" valign="middle">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="200" align="center" valign="middle"> </td>
<td align="center" valign="middle"><p> </p>
<p> </p></td>
<td width="200"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="middle">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="135" align="left" valign="middle"
background="https://top.new-combats.com/images/sitebk_02.jpg"
style="background-repeat:repeat-x">
</td>
<td width="135" align="right" valign="middle"
background="https://top.new-combats.com/images/sitebk_02.jpg"
style="background-repeat:repeat-x">
</td>
</tr>
<tr>
</td>
<td height="150" align="center" valign="middle" class="menu">
<p><b>Забыли пароль от своего персонажа?</b></p>
<p> <?
if ($error != '') {
echo '<font color="red"><b>' . $error . '</b></font>';
}
?></p>
<form method="post" action="https://new-combats.com/repass.php">
<?
if ($step == 1) { ?>
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Укажите логин персонажа:</td>
<td><input onfocus="if ( 'Логин' == value ) { value = ''; } "
onblur="if ( '' == value ) { value = 'Логин'; } " value="Логин"
maxlength="40" style="padding:3px" name="relogin" type="text"
class="inup" id="relogin"></td>
</tr>
</table><br>
<input type="submit" class="btn" value="Перейти к следующему шагу">
<? } elseif ($step == 2) { ?>
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>Логин персонажа:</td>
<td>
<input value="<?= $_POST['relogin'] ?>" disabled maxlength="40"
style="padding:3px" type="text" class="inup">
<input type="hidden" name="relogin" value="<?= $_POST['relogin'] ?>">
</td>
</tr>
<?
if ($usr['a1'] != '') { ?>
<tr>
<td>Ваш вопрос:</td>
<td> <b><?= $usr['a1'] ?></b></td>
</tr>
<tr>
<td>Ваш ответ:</td>
<td><input value="<?= $_POST['reanswer'] ?>" name="reanswer" maxlength="30"
style="padding:3px" type="text" class="inup"></td>
</tr>
<? } ?>
<tr>
<td>Ваш день рождения:</td>
<td><input value="<?= $_POST['redate'] ?>" name="redate" maxlength="10"
style="padding:3px" type="text" class="inup"></td>
</tr>
</table>
<small class="testro">(день рождения вы указывали при регистрации персонажа в формате
dd.mm.yyyy)</small>
<br>
<br>
<br>
<input type="button" onclick="top.location.href='https://new-combats.com/repass.php'"
class="btn" value="Вернуться">
<input type="submit" class="btn" value="Выслать пароль на E-mail">
<? } ?>
</form>
<br><br><br><br>
</td>
</tr>
</table>
<div align="center" class="menu">
<a href="https://new-combats.com/">Вернутся на главную страницу</a>
</div>
</td>
</tr>
<tr>
<td height="50" align="center" valign="middle"> </td>
</tr>
<tr>
<td height="50" align="center"><span
class="testro">«Старый Бойцовский Клуб» 2018-<?= date('Y') ?> © Браузерная онлайн игра</span>
</td>
</tr>
2022-06-07 00:30:34 +03:00
</table>
</body>
</html>