Дозаливка
This commit is contained in:
+48
-13
@@ -1,5 +1,12 @@
|
||||
<?php
|
||||
require_once '_incl_data/mails.php';
|
||||
|
||||
use Core\Config;
|
||||
use Core\Database;
|
||||
|
||||
if (!defined('GAME_VERSION')) {
|
||||
require_once '_incl_data/autoload.php';
|
||||
}
|
||||
|
||||
$step = 1;
|
||||
$error = '';
|
||||
|
||||
@@ -10,30 +17,48 @@ if (isset($_GET['login'])) {
|
||||
if (isset($_POST['relogin'])) {
|
||||
$_POST['relogin'] = htmlspecialchars($_POST['relogin'], null, 'cp1251');
|
||||
|
||||
define('GAME', true);
|
||||
require_once('_incl_data/__config.php');
|
||||
require_once('_incl_data/class/__db_connect.php');
|
||||
Config::init();
|
||||
Database::init();
|
||||
define('IP', UserIp::get());
|
||||
|
||||
$usr = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['relogin']) . '" LIMIT 1'));
|
||||
|
||||
$usr = mysql_fetch_array(
|
||||
mysql_query(
|
||||
'SELECT * FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['relogin']) . '" LIMIT 1'
|
||||
)
|
||||
);
|
||||
if (isset($usr['id'])) {
|
||||
|
||||
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'));
|
||||
$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'] == '')) {
|
||||
} 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']) {
|
||||
$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'] < Config::get('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);
|
||||
$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>';
|
||||
@@ -44,10 +69,20 @@ if (isset($_POST['relogin'])) {
|
||||
$txt .= 'Ñ óâàæåíèåì,<br>';
|
||||
$txt .= 'Àäìèíèñòðàöèÿ Áîéöîâñêîãî Êëóáà';
|
||||
|
||||
$mail = mails($usr['mail'], $txt, $title);
|
||||
//$mail = mails($usr['mail'], $txt, $title);
|
||||
$mail = Core\Mail::send($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() . '")');
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user