Файл: monst/core/pag/start.php
Строк: 37
<noscript>
<meta http-equiv="refresh" content="0;URL=/?error=javascript" />
</noscript>
<?
if ( !isset($_GET['1']) ) {
Cook_set('test', 1);
?>
<script>
document.cookie = 'test2=1';
window.location = '/start?1';
</script>
<?
// g('/start?1');
} else {
if ( !isset($_COOKIE['test']) ) {
g('/?error=cookies');
}
if ( !isset($_COOKIE['test2']) ) {
g('/?error=javascript');
}
$DEBUG = 1;
if ( !$DEBUG ) {
if ((isset($_SESSION['reg']) AND $_SESSION['reg'] > 20) OR (isset($_COOKIE['reg']) AND $_COOKIE['reg'] > 20)) {
g('/?error=limit');
}
// $find = $_users -> find(
// [
// 'ip' => $ip,
// 'r_time' =>
// [
// '$gte' => time() - 60 * 1
// ]
// ]
// );
//
// $ip_count = $find -> count();
// if ($ip_count > 3) {
// g('/?error=limit');
// }
$find = $_users -> find(
[
'ip' => $ip,
'r_time' =>
[
'$gte' => time() - 60 * 20
]
]
);
$ip_count = $find -> count();
if ($ip_count > 50) {
g('/?error=limit');
}
}
$id = new_id('_users');
if ($L == 'ru') {
$name = 'Новичок ' . $id;
} else {
$name = 'Newbie ' . $id;
}
$pass = md5(r() . r() . 'demonpass');
$insert = $_users -> insert(
[
'id' => $id,
'name' => $name,
'pass' => $pass,
'r_time' => time(),
'l_time' => time(),
'user_agent' => $user_agent,
'ip' => $ip,
'account_saved' => 0,
'lang' => $_SESSION['lang'],
'referer' => $_SESSION['referer'],
'from' => $_SESSION['from'],
]
);
Cook_set('id', $id);
Cook_set('pass', $pass);
$_SESSION['reg'] = (int)$_SESSION['reg'] + 1;
Cook_set('reg', (int)$_COOKIE['reg'] + 1);
//$_SESSION['training'] = 1;
g('/');
}