game/adminion/index.php

359 lines
16 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
$sd4 = 'admin';
$psw = md5('tip:' . $_SERVER['REMOTE_ADDR'] . 't' . date('dh', time()) . 't' . $sd4);
$psw = $psw[7] . $psw[3] . $psw[0] . $psw[1] . $psw[5];
$auth = false;
$_POST['psw'] = $psw;
if (isset($_COOKIE['pass3']) && $_COOKIE['pass3'] == $psw) {
$auth = true;
}
if (isset($_GET['code'])) {
$tpsw = md5('tip:' . $_SERVER['REMOTE_ADDR'] . 't' . $_GET['code'] . 't' . $sd4);
$tpsw = $tpsw[7] . $tpsw[3] . $tpsw[0] . $tpsw[1] . $tpsw[5];
die($tpsw);
} elseif (isset($_POST['psw'])) {
if ($_POST['psw'] == $psw) {
setcookie('pass3', $_POST['psw'] ?? '', time() + 36000);
$_COOKIE['pass3'] = $_POST['psw'];
$auth = true;
}
} elseif (isset($_GET['exit'])) {
if ($_COOKIE['pass3'] == $psw) {
setcookie('pass3', false, time() - 3600);
unset($_COOKIE['pass3']);
$auth = false;
}
}
include_once('../_incl_data/__config.php');
define('GAME', true);
include_once('../_incl_data/class/__db_connect.php');
include_once('../_incl_data/class/__user.php');
if ($u->info['admin'] = 0) {
die(':KING:');
}
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<meta http-equiv=Expires Content=0>
<title>Центр управления "Adminion"</title>
<link href="https://<?= $c['img'] ?>/css/main.css" rel="stylesheet" type="text/css">
<style>
.tblbr2 {
border-left: 1px solid #AEAFAE;
border-top: 1px solid #AEAFAE;
border-bottom: 1px solid #EEEFEE;
border-right: 1px solid #EEEFEE;
}
.tblbr {
border-left: 1px solid #EEEFEE;
border-top: 1px solid #EEEFEE;
border-bottom: 1px solid #AEAFAE;
border-right: 1px solid #AEAFAE;
}
.стиль1 {
border-left: 1px solid #AEAFAE;
border-top: 1px solid #AEAFAE;
border-bottom: 1px solid #EEEFEE;
border-right: 1px solid #EEEFEE;
font-size: 12px;
}
.стиль2 {
font-size: 12px;
color: #999999;
}
.стиль5 {
font-size: 12px
}
.test a {
font-weight: normal;
}
</style>
</head>
<body style="padding-top:0px; margin-top:2px; background-color:#dedfde;">
<table class="tblbr" width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td class="стиль1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Adminion v0.0.0
<?php if ($auth == true) {
$la = sys_getloadavg();
$la[0] = $la[0] / 4;
$la[1] = $la[1] / 4;
$la[2] = $la[2] / 4;
?>
/ Время сервера: <?= date('H:i') ?> ( <?= time() ?> ) / <?php
echo "Нагрузка: " . round($la[0] * 100, 2) . "% ";
if ($la[1] < 0.16) {
echo "<font color=green>низкая</font>";
} elseif ($la[1] < 0.25) {
echo "<font color=orange>средняя</font>";
} elseif ($la[1] > 0.25) {
echo "<font color=red>высокая</font>";
}
?>
<?php }
$online = 0;
$sp = mysql_query('SELECT `id`,`room`,`city` FROM `users` WHERE `online` > (' . time() . '-600)');
while ($pl = mysql_fetch_array($sp)) {
$online++;
}
?> / Онлайн: <?= $online ?> / Нагрузка USI: <?= round((round($la[2] * 100, 2) / $online), 2) ?>%
</td>
<td>&nbsp;</td>
<td><?php if ($auth == true) { ?>
<div align="right"><a href="../adminion/?exit=<?= $code ?>">Выйти</a></div><?php } ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<div align="center">
<?php
if (!isset($_COOKIE['pass3']) || $_COOKIE['pass3'] != $psw){
?>
<form action="../adminion/index.php" method="post">
<center><br><br>
<span class="стиль5"><br>
Для входа в панель требуется пароль</span>
<hr>
<span class="стиль5">Введите пароль:
<input value="" name="psw" type="password">
<input type="submit" value="ок"/>
</span>
</form>
</div>
<?php
} else {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" height="18" valign="top">
<table class="test" width="100%" border="0" align="left" cellpadding="2" cellspacing="0">
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Общие настройки</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Настройка сервера</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Настройки модулей</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Персонажи</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Поиск персонажей</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Работа с персонажем</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Работа с ботом</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Предметы</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Поиск предмета</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Работа с предметом</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Предметы у персонажей</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Локации</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Поиск локации</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Работа с локацией</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Добавить локацию</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Действия</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Проверить переводы</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Проверить действия</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Проверить чат</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Поединки</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Поиск поединка</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Настройки баланса</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td bgcolor="#C0C2C0">
<div align="left" class="tblbr"><strong style="margin-left:10px;">Пещеры</strong></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="../adminion/?mod=dungeon_list">Список пещер</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="../adminion/?mod=dungeon&r=1">Редактор лабиринтов</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="../adminion/?mod=dungeon_bots">Редактор ботов</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="../adminion/?mod=dungeon_editor">Редактор пещер</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="../adminion/?mod=dobj&r=1">Работа с обьектами</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Создать пещеру</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Работа с квестами</a></div>
</td>
</tr>
<tr>
<td>
<div align="left"><a href="#">Создать квест</a></div>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td valign="top" style="padding:10px;">
<?php
if (isset($_GET['mod'])) {
if (file_exists('../adminion/mod/' . htmlspecialchars($_GET['mod'], null) . '.php')) {
include('../adminion/mod/' . htmlspecialchars($_GET['mod'], null) . '.php');
} else {
echo '<center>У вас нет доступа к данному разделу</center>';
}
} else {
echo '<center>Выберите раздел</center>';
}
?></td>
</tr>
</table>
<?php
}
?></td>
</tr>
</table>
</body>
</html>