diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 7bc0911f36..5d8affe211 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2012-06-21 Hirofumi Kosaka + + * extensions/pandora_logs.php: show the last 500k bytes + instead error message, if the file is too large. + Merged from 4.0.2 + 2012-06-21 Hirofumi Kosaka * extensions/net_tools.php: Use 'whereis' to get command path diff --git a/pandora_console/extensions/pandora_logs.php b/pandora_console/extensions/pandora_logs.php index 85b8bf779c..b4dc447c7c 100644 --- a/pandora_console/extensions/pandora_logs.php +++ b/pandora_console/extensions/pandora_logs.php @@ -22,12 +22,18 @@ function view_logfile ($file_name) { echo ")"; } else { - if (filesize ($file_name) > 512000) { - echo "

".__("File is too large (> 500KB)"). "(".$file_name; - echo ")

"; + $file_size = filesize($file_name); + if ($file_size > 512000) { + $data = file_get_contents ($file_name, false, NULL, $file_size - 512000); + echo "

$file_name (".__("File is too large (> 500KB)").")

"; + + echo "

"; } else { - $data = file_get_contents ($file_name); + $data = file_get_contents ($file_name); echo "

$file_name (".format_numeric(filesize ($file_name)/1024)." KB)

"; echo "