* Project name: Battles-Game
*/
require_once '../functions.php';
use Battles\Admin\Clan;
use Battles\Chat;
use Battles\Database\Db;
use Battles\Moderation;
use Battles\Template;
use Battles\User;
if (!User::getInstance()->getAdmin()) {
header("HTTP/1.0 404 Not Found");
exit;
}
if (isset($_GET['sleep'])) {
Moderation::muteChat(User::getInstance()->getId(), strtotime('15min'));
}
if (isset($_POST['ldnick']) && isset($_POST['ldtext'])) {
Moderation::addToUserLog(User::getInstance($_POST['ldnick'])->getId(), $_POST['ldtext'], User::getInstance()->getId());
}
if (isset($_POST['syschatmsg'])) {
Moderation::addChatSysMsg($_POST['syschatmsg']);
}
//clans to reg
Clan::getUnapprovedList();
if (isset($_GET['regclan'])) {
Clan::allowRegister($_GET['regclan']);
header('Location:/admin/admin.php');
exit;
}
if (isset($_GET['remclan'])) {
Clan::disallowRegister($_GET['remclan']);
header('Location:/admin/admin.php');
exit;
}
# Телеграф.
if (!empty($_POST['receiver']) && !empty($_POST['tgmsg'])) {
$receiver = Db::getInstance()->ofetch('SELECT id FROM users WHERE login= ?', $_POST['receiver']);
Chat::sendTelegraf($_POST['tgmsg'], $receiver->id);
echo "Успешно.";
}
# Показывает невидимок.
$row = Db::getInstance()->ofetchAll('SELECT id,login FROM users LEFT JOIN users_effects ue on users.id = ue.owner_id WHERE type = 1022 ORDER BY `id` DESC');
foreach ($row as $r) {
$invisList .= '[id] = ' .$r->id. ', ' .$r->login. '
';
}
Template::header('ᐰdminка');
?>
Абилки. Работают только на себя. Надо дописать цель.