2016-01-01 07:42:52 -05:00
|
|
|
<?php
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
if (isset($_POST['password'])) {
|
|
|
|
$_SESSION['password'] = $_POST['password'];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_SESSION['password'])) {
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
if ($_SESSION['password'] != "-D-Star+") {
|
|
|
|
echo '
|
|
|
|
<form name="frmpass" action="./xlxlog.php" method="post">
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
<input type="password" name="password" />
|
|
|
|
<input type="submit" />
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
</form>';
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
die();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo '
|
|
|
|
<form name="frmpass" action="./xlxlog.php" method="post">
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
<input type="password" name="password" />
|
|
|
|
<input type="submit" />
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
</form>';
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
die();
|
|
|
|
}
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
|
|
<title>XLX Live Log</title>
|
|
|
|
<script>
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
function ReloadPage() {
|
|
|
|
document.location.href = "./xlxlog.php";
|
|
|
|
}
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
setTimeout(ReloadPage, 1000);
|
2016-02-11 12:51:12 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
<pre>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
$a = array();
|
|
|
|
$handle = fopen("/var/log/messages","r");
|
|
|
|
if ($handle) {
|
|
|
|
while(!feof($handle)) {
|
|
|
|
$a[] = fgets($handle, 1024);
|
|
|
|
}
|
|
|
|
fclose($handle);
|
|
|
|
}
|
|
|
|
|
|
|
|
$a = array_reverse($a);
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
$max = 65;
|
|
|
|
if (count($a) < 65) $max = count($a);
|
2016-02-11 12:51:12 -05:00
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
for ($i=0;$i<$max;$i++) {
|
2016-02-11 12:51:12 -05:00
|
|
|
echo $a[$i];
|
|
|
|
}
|
|
|
|
|
2016-01-01 07:42:52 -05:00
|
|
|
?>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|