Файл: _modules/main/donat/login/index.php
Строк: 67
<?php
# mark core v1.0
# author Drk in
# date 24.10.19
# core
require_once ( $_SERVER['DOCUMENT_ROOT']."/_core/system.php" );
# user
system::access(true);
# meta
$title = 'Магазин - изменение логина :: '.domain;
# post
if (isset($_POST['CFMS'])):
$login = system::check($_POST['login']);
$CK = system::check($_POST['CK']);
$check = DB :: $dbh -> querySingle("SELECT count(id) FROM user WHERE lower(login) = ? LIMIT 1;", array(strtolower($login)));
$antiflood = DB :: $dbh -> querySingle("SELECT count(id) FROM journal WHERE user = ? AND time > ?;", array($user['id'],time()-10));
if (empty($check)):
if (system::utf_strlen($login) > 1): if (system::utf_strlen($login) <= 18):
if (preg_match("#^([A-zА-я0-9_])+$#ui", $login)):
if (substr_count($login,"_") < 2 ):
if ($CK == $user['CK']):
if ($user['bits'] >= $config['price_login']):
if (empty($antiflood)):
DB :: $dbh -> query("UPDATE user SET bits = (bits - '".$config['price_login']."'), login = ? WHERE id = ? LIMIT 1;",array($login,$user['id']));
cache_user::save($user['id']);
# journal
send::journal($user['id'],'Изменение логина на '.$login,$config['price_login']);
system::header('?', 'Логин успешно изменен!');
# error
else: system::header('?', 'Не так быстро, подожди не много'); endif;
else: system::header('?', 'Ошибка, не достаточно средств'); endif;
else: system::header('?', 'Ошибка, возможно вам подкинули эту ссылку'); endif;
else: system::header('?', 'Ошибка, нельзя использовать больше одного подчёркивания'); endif;
else: system::header('?', 'Ошибка, имя из не понятных символов'); endif;
else: system::header('?', 'Ошибка, слишком длинное имя'); endif;
else: system::header('?', 'Ошибка, слишком короткое имя'); endif;
else: system::header('?', 'Ошибка, имя уже занято'); endif;
endif;
# head
require_once ( head );
echo '
'.system::dis().'
<div class="fights fights-about"><div class="grid">
Стоимость смены логина - <font color="#82e42b">'.$config['price_login'].'</font> <img src="'.ico.'dollar.png" width="10px"></div></div>
<div class="fights fights-about">
'.($user['bits'] < $config['price_login'] ? 'На вашем счету не достаточно средств - <a href="/main/biling">Пополнить</a>':'
<form method="post">
<small>Имя (от 2 до 18 символов):</small>
<input type="hidden" name="CK" value="'.$user['CK'].'">
<input type="text" name="login" value="" placeholder="Введите имя..." style="width: 96%;">
<input type="submit" name="CFMS" value="Изменить">
').'
</div>
<div class="fights-link" style="margin: 5px;"><a href="/main/donat">Вернуться назад</a></div>
<div class="line"></div>
';
# foot
require_once ( foot );
?>