game/modules_data/moder/useban.php

43 lines
1.5 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2023-12-01 23:34:49 +00:00
if (!defined('GAME')) {
die();
2022-06-06 21:30:34 +00:00
}
2023-12-01 23:34:49 +00:00
if ($p['banned'] != 1 && $p['ban0'] != 1) {
$uer = 'У Вас нет прав на использование данного заклятия';
return;
}
$uu = \Core\Db::getRow('select id, login, banned, battle, mail from users where login = ? order by id limit 1', [$_POST['logingo']]);
if (!isset($uu['id'])) {
$uer = 'Персонаж не найден в этом городе';
return;
}
if ($uu['banned'] > 0) {
$uer = 'Персонаж уже заблокирован.';
return;
}
(new \Moderation\Moderation($uu['id']))->ban();
\Core\Db::sql('delete from chat where login = ?', [$uu['login']]);
\Core\Db::sql('insert into ban_email (email, uid, nick_name) values (?,?,?)', [$uu['mail'], $uu['id'], $uu['login']]);
\Core\Db::sql('delete from zayvki where creator = ?', [$uu['id']]); // Удаляем заявки на бой.
\Core\Db::sql('delete from dungeon_zv where uid = ?', [$uu['id']]); // Удаляем заявки в пещеры.
if (!empty($uu['battle'])) {
\Core\Db::sql('update users left join stats on users.id = stats.id set battle = default, regHP = unix_timestamp(), team = 0, battle_yron = 0, battle_exp = 0 where users.id = ?', [$uu['id']]);
}
$rtxt = "Персонаж {$uu['login']} заблокирован.";
2023-01-28 02:24:37 +00:00
$cmsg = new ChatMessage();
$cmsg->setRoom($u->info['room']);
2023-12-01 23:34:49 +00:00
$cmsg->setText("[img[items/pal_button6.gif]] $rtxt");
2023-01-28 02:24:37 +00:00
$cmsg->setType(6);
$cmsg->setTypeTime(1);
(new Chat())->sendMsg($cmsg);
2023-12-01 23:34:49 +00:00
$uer = $rtxt;