mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Remove outdated logging code
This commit is contained in:
parent
a040289eae
commit
08db10f5ce
40
index.php
40
index.php
|
|
@ -18,46 +18,6 @@ if (isset($_REQUEST['month']) && $roomid) {
|
|||
}
|
||||
}
|
||||
|
||||
$file = null;
|
||||
if (isset($_REQUEST['file']) && $month && $roomid) {
|
||||
$file = $_REQUEST['file'];
|
||||
$logfile = $config['logdirectory'] . '/' . $roomid . '/' . $month . '/' . $file;
|
||||
if (!preg_match('/^[0-9]+-[0-9]+-[0-9]+\.txt$/', $file) || !file_exists($logfile)) {
|
||||
die('Invalid file specified.');
|
||||
}
|
||||
// record this log access in the database
|
||||
if ($config['db_server']) {
|
||||
$db = new mysqli(
|
||||
$config['db_server'],
|
||||
$config['db_username'],
|
||||
$config['db_password'],
|
||||
$config['db_database']
|
||||
);
|
||||
$db->query(
|
||||
'INSERT INTO `' .
|
||||
$config['db_prefix'] .
|
||||
'logviewerlog` (userid, filename) VALUES (\'' .
|
||||
$db->real_escape_string($user['userid']) .
|
||||
'\', \'' .
|
||||
$db->real_escape_string($roomid . '/' . $month . '/' . $file) .
|
||||
'\')'
|
||||
);
|
||||
$db->close();
|
||||
}
|
||||
// output the log file
|
||||
header('Content-Type: text/plain;charset=utf-8');
|
||||
if (!isset($_REQUEST['onlychat'])) {
|
||||
readfile($logfile);
|
||||
} else {
|
||||
$lines = file($logfile);
|
||||
foreach ($lines as &$i) {
|
||||
if (preg_match('/\|(N|J|L|userstats)\|/', $i)) continue;
|
||||
echo $i;
|
||||
}
|
||||
}
|
||||
die;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user