2012-06-21 Hirofumi Kosaka <kosaka@rworks.jp>

* extensions/pandora_logs.php: show the last 500k bytes
	instead error message, if the file is too large.
	Merged from 4.0.2


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6644 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
hkosaka 2012-06-21 09:43:26 +00:00
parent 4f782d0b7a
commit 130ccd476b
2 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2012-06-21 Hirofumi Kosaka <kosaka@rworks.jp>
* 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 <kosaka@rworks.jp>
* extensions/net_tools.php: Use 'whereis' to get command path

View File

@ -22,9 +22,15 @@ function view_logfile ($file_name) {
echo ")</h2>";
}
else {
if (filesize ($file_name) > 512000) {
echo "<h2 class='error'>".__("File is too large (> 500KB)"). "(".$file_name;
echo ")</h2>";
$file_size = filesize($file_name);
if ($file_size > 512000) {
$data = file_get_contents ($file_name, false, NULL, $file_size - 512000);
echo "<h2>$file_name (".__("File is too large (> 500KB)").")</h2>";
echo "<textarea style='width: 98%; float:right; height: 200px; margin-bottom:20px;' name='$file_name'>";
echo "... ";
echo $data;
echo "</textarea><br><br>";
}
else {
$data = file_get_contents ($file_name);