log fix
This commit is contained in:
parent
784901be2f
commit
1d839e0106
3 changed files with 24 additions and 5 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
require_once('../../includes/lib_remote.php');
|
||||
require_once('../../modules/config_games/server_config_parser.php');
|
||||
require_once('../../includes/functions.php');
|
||||
require_once(__DIR__ . '/../../includes/lib_remote.php');
|
||||
require_once(__DIR__ . '/../../modules/config_games/server_config_parser.php');
|
||||
require_once(__DIR__ . '/../../includes/functions.php');
|
||||
|
||||
// Get parameters from GET
|
||||
$home_id = isset($_GET['home_id']) ? $_GET['home_id'] : null;
|
||||
|
|
@ -38,6 +38,11 @@ $home_log = implode("\n", array_slice($lines, -40));
|
|||
if ($log_retval > 0) {
|
||||
echo "<pre style='background:black;color:white;'>".htmlspecialchars($home_log)."</pre>";
|
||||
} else {
|
||||
echo "<pre style='background:black;color:white;'>Unable to get log: $log_retval</pre>";
|
||||
if ($log_retval == -8 && isset($log_path) && preg_match('/[*?\[]/', $log_path)) {
|
||||
$wildcardMsg = !empty($home_log) ? $home_log : ("No log files matched pattern: " . $log_path);
|
||||
echo "<pre style='background:black;color:white;'>" . htmlspecialchars($wildcardMsg, ENT_QUOTES, 'UTF-8') . "</pre>";
|
||||
} else {
|
||||
echo "<pre style='background:black;color:white;'>Unable to get log: $log_retval</pre>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -162,7 +162,17 @@ require_once("modules/config_games/server_config_parser.php");
|
|||
}
|
||||
else
|
||||
{
|
||||
if ($log_retval == -8 && isset($log_path) && preg_match('/[*?\[]/', $log_path))
|
||||
{
|
||||
if (!empty($home_log))
|
||||
print_failure(htmlentities($home_log, ENT_QUOTES, "UTF-8"));
|
||||
else
|
||||
print_failure("No log files matched pattern: " . htmlentities($log_path, ENT_QUOTES, "UTF-8"));
|
||||
}
|
||||
else
|
||||
{
|
||||
print_failure(get_lang_f('unable_to_get_log',$log_retval));
|
||||
}
|
||||
echo create_back_button( $_GET['m'], 'game_monitor&home_id-mod_id-ip-port='.$_GET['home_id-mod_id-ip-port'] );
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue