Пример #1
0
<?php

if (isset($_SESSION['user_id']) and strpos($_SESSION['user_permissions'], "control") !== false) {
    if (file_exists("C:\\arma\\@dayzcc_config\\" . $serverinstance . "\\BEC\\Log\\instance" . $serverinstance . "\\Chat\\Chat_" . date("Y-m-d") . ".log")) {
        require_once 'modules/file.php';
        $say = explode("\n", str_replace("\r", "", last_lines("C:\\arma\\@dayzcc_config\\" . $serverinstance . "\\BEC\\Log\\instance" . $serverinstance . "\\Chat\\Chat_" . date("Y-m-d") . ".log", 50)));
        $say = array_reverse($say);
        array_shift($say);
    } else {
        $say = "file not found\n";
    }
    ?>

	<h2>Global chat:</h2>
	<form action="index.php?view=actions" method="post">
		<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
			<tr>
				<td align="center" width="50%">
								<textarea style="width: 99.7%; height: 165px; white-space: nowrap;" wrap="off" readonly><?php 
    echo implode("\n", $say);
    ?>
</textarea>
								<textarea name="say" style="width: 80%; height: 22px; margin-top: 7px;"></textarea>
								<input type="submit" class="submit" style="display: inline; vertical-align: top; margin-top: 5px;" />
				</td>
			</tr>
		</table>
	</form>
	<br />

<?php 
Пример #2
0
									<p class="panel-subtitle">Scanning of all <kbd>error_log</kbd> files on the site and displaying all errors, warnings and notices.</p>
								</header>
								<div class="panel-body">

<?php 
$log_errors = ini_get('log_errors');
if (!$log_errors) {
    echo '<p>Error Logging is disabled on your server</p>';
}
$error_log = ini_get('error_log');
$logs = array($error_log);
$count = 10000;
$lines = array();
foreach ($logs as $log) {
    if (is_readable($log)) {
        $lines = array_merge($lines, last_lines($log, $count));
    }
}
$lines = array_map('trim', $lines);
$lines = array_filter($lines);
if (empty($lines)) {
    //echo '<p>No errors found...</p>';
}
foreach ($lines as $key => $line) {
    if (false != strpos($line, ']')) {
        list($time, $error) = explode(']', $line, 2);
    } else {
        list($time, $error) = array('', $line);
    }
    $time = trim($time, '[]');
    $error = trim($error);
Пример #3
0
    $chat = array();
    $say = array();
    $res = mysql_query("SELECT * FROM `log_tool` ORDER BY `timestamp` DESC LIMIT 150");
    while ($row = mysql_fetch_array($res)) {
        $log[] = $row['timestamp'] . ' ' . $row['user'] . ': ' . $row['action'];
    }
    if (isset($_POST['comment'])) {
        if ($_POST['comment'] != "") {
            $file = fopen("comments.log", file_exists("comments.log") ? 'a' : 'w');
            fwrite($file, date('Y-m-d h:i') . " " . $_SESSION['login'] . ": " . $_POST['comment'] . "\n");
            fclose($file);
        }
    }
    if (file_exists("comments.log")) {
        require_once 'modules/file.php';
        $chat = explode("\n", str_replace("\r", "", last_lines("comments.log", 150)));
        $chat = array_reverse($chat);
        array_shift($chat);
    }
    function getIP()
    {
        $ip = file_get_contents("http://checkip.dyndns.org/");
        $ip = trim(substr($ip, 76, -16));
        if (!filter_var($ip, FILTER_VALIDATE_IP)) {
            $ip = gethostbyname(trim(`hostname`));
        }
        return $ip;
    }
    ?>

	<div id="page-heading">
Пример #4
0
                 echo "</table>";
             } else {
                 echo '<div id="page-heading"><h2>No server log files found.</h2></div>';
             }
             break;
     }
 } else {
     if (isset($_GET['display'])) {
         $file = $_GET['display'];
         if ($file != "") {
             $path_parts = pathinfo($file);
             $file = $path_parts['basename'];
             if (substr(strtolower($file), -strlen(".log")) === ".log" || substr(strtolower($file), -strlen(".log")) === ".rpt") {
                 $filepath = $patharma . "\\@dayzcc_config\\" . $serverinstance . "\\" . ($_GET['type'] == "battleye" ? "BattlEye\\" : "") . $file;
                 if (file_exists($filepath)) {
                     echo '<textarea name="say" rows="30" wrap="off" style="width: 99%; white-space: nowrap;" readonly>' . last_lines($filepath, 100) . '</textarea>';
                 } else {
                     echo '<div id="page-heading"><h2>File not found: ' . $filepath . '<h2></div>';
                 }
             } else {
                 echo '<div id="page-heading"><h2>Invalid file specified.<h2></div>';
             }
         } else {
             echo '<div id="page-heading"><h2>Invalid file specified.<h2></div>';
         }
     } else {
         if (isset($_GET['download'])) {
             $file = $_GET['download'];
             if ($file != "") {
                 echo '<script type="text/javascript">window.open("modules/lib/download.php?file=' . $file . ($_GET['type'] == "battleye" ? "&battleye" : "") . '"); window.location = "index.php?view=log&type=' . $_GET['type'] . '";</script>';
             } else {