<?php require_once 'core.php'; require_once 'utils.php'; require_once 'automoderation_history.php'; // со страницы истории дата запрашивается без секунд $dateFormat = 'Y-m-d H:i'; global $memcache; $history = new ChatAutomoderationHistory($memcache); // по всем каналам $startDate = date($dateFormat, CURRENT_TIME - 3600 * 24); $endDate = date($dateFormat, CURRENT_TIME); $result = $history->Get('', $startDate, $endDate, '', '', false, 'last.json');
$channelId = 0; } $result = $chat->BanUser($_POST['banUserId'], $_POST['userName'], $_POST['duration'], $_POST['messageId'], $channelId); $result = array_merge($chat->user, $result); echo json_encode($result); break; case 'GetHistory': include 'history.php'; $history = new ChatHistory(); list($channelId, $startDate, $endDate, $nick) = GetHistoryParamsFromPost(); $result = $history->Get($channelId, $startDate, $endDate, $nick, IsModeratorRequest($chat->user)); echo json_encode($result); break; case 'GetAutoModerationHistory': include 'automoderation_history.php'; $history = new ChatAutomoderationHistory($memcache); list($channelId, $startDate, $endDate, $nick) = GetHistoryParamsFromPost(); if (isset($_POST['bannedNick'])) { $bannedNick = $_POST['bannedNick']; } else { $bannedNick = ''; } $result = $history->Get($channelId, $startDate, $endDate, $nick, $bannedNick, IsModeratorRequest($chat->user)); echo json_encode($result); break; case 'CitizenVoteForUserBan': include 'automoderation.php'; $citizenModerator = new AutoModeration($memcache, $chat->user); $result = $citizenModerator->VoteForUserBan($_POST['banUserId'], $_POST['userName'], $_POST['messageId'], $_POST['reasonId']); $result = array_merge($chat->user, $result); echo json_encode($result);