* Project name: Battles-Game
*/
require_once '../config.php';
use Battles\Admin\Clan;
use Battles\Admin\User as AUser;
use Battles\Chat;
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'])) {
Chat::sendTelegraf($_POST['tgmsg'], User::getInstance($_POST['receiver'])->getId());
echo "Успешно.";
}
Template::header('ᐰdminка');
?>
Абилки. Работают только на себя. Надо дописать цель.