closes #17, великое переименование классов для автозагрузчика, актуализация кода
This commit is contained in:
28
_incl_data/class/UserRegister.php
Normal file
28
_incl_data/class/UserRegister.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class UserRegister
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
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'];
|
||||
}
|
||||
define('IP', $ip);
|
||||
if ($_SERVER['HTTP_REFERER'] == 'https://new-combats.com/' && $_COOKIE['acomb1'] != '2') {
|
||||
setcookie('acomb1', '1', time() + 60 * 60 * 24 * 3);
|
||||
}
|
||||
}
|
||||
|
||||
public function en_ru($txt)
|
||||
{
|
||||
$en = preg_match("/^(([0-9A-z _-])+)$/i", $txt);
|
||||
$ru = preg_match("/^(([0-9<>-<2D> _-])+)$/i", $txt);
|
||||
return ($ru && $en) || (!$ru && !$en);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user