diff --git a/plugins/Diagnostics/index.php b/plugins/Diagnostics/index.php index 9369c4d..a17f428 100644 --- a/plugins/Diagnostics/index.php +++ b/plugins/Diagnostics/index.php @@ -1,11 +1,10 @@ server_version<50500) echo('Warning: Lychee uses the GBK charset to avoid sql injections on your MySQL version. Please update to MySQL 5.5 or higher to enable UTF-8 support.' . PHP_EOL); -# Output -if ($error==='') echo('No critical problems found. Lychee should work without problems!' . PHP_EOL); -else echo $error; +// Output +if ($error==='') echo('No critical problems found. Lychee should work without problems!' . PHP_EOL); +else echo $error; -# Show separator +// Show separator echo(PHP_EOL . PHP_EOL . 'System Information' . PHP_EOL); echo('------------------' . PHP_EOL); -# Ensure that user is logged in +// Ensure that user is logged in if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& (isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) { - # Load json + // Load json $json = file_get_contents(LYCHEE_SRC . 'package.json'); $json = json_decode($json, true); - # About imagick + // About imagick $imagick = extension_loaded('imagick'); - if ($imagick===true) $imagickVersion = @Imagick::getVersion(); - else $imagick = '-'; - if (!isset($imagickVersion, $imagickVersion['versionNumber'])||$imagickVersion==='') $imagickVersion = '-'; - else $imagickVersion = $imagickVersion['versionNumber']; + if ($imagick===true) $imagickVersion = @Imagick::getVersion(); + else $imagick = '-'; + if (!isset($imagickVersion, $imagickVersion['versionNumber'])||$imagickVersion==='') $imagickVersion = '-'; + else $imagickVersion = $imagickVersion['versionNumber']; - # Output system information + // Output system information echo('Lychee Version: ' . $json['version'] . PHP_EOL); echo('DB Version: ' . $settings['version'] . PHP_EOL); echo('System: ' . PHP_OS . PHP_EOL); @@ -133,10 +132,10 @@ if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& } else { - # Don't go further if the user is not logged in + // Don't go further if the user is not logged in echo('You have to be logged in to see more information.'); exit(); } -?> +?> \ No newline at end of file diff --git a/plugins/Log/index.php b/plugins/Log/index.php index 1ff92c6..b20da7e 100644 --- a/plugins/Log/index.php +++ b/plugins/Log/index.php @@ -1,11 +1,10 @@ query($query); + // Result + $query = Database::prepare(Database::get(), "SELECT FROM_UNIXTIME(time), type, function, line, text FROM ?", array(LYCHEE_TABLE_LOG)); + $result = Database::get()->query($query); - # Output + // Output if ($result->num_rows===0) { echo('Everything looks fine, Lychee has not reported any problems!'); @@ -45,11 +44,11 @@ if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& while($row = $result->fetch_row()) { - # Encode result before printing + // Encode result before printing $row = array_map('htmlentities', $row); - # Format: time TZ - type - function(line) - text - printf ("%s - %s - %s (%s) \t- %s\n", $row[0], $row[1], $row[2], $row[3], $row[4]); + // Format: time TZ - type - function(line) - text + printf("%s - %s - %s (%s) \t- %s\n", $row[0], $row[1], $row[2], $row[3], $row[4]); } @@ -57,10 +56,10 @@ if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&& } else { - # Don't go further if the user is not logged in + // Don't go further if the user is not logged in echo('You have to be logged in to see the log.'); exit(); } -?> +?> \ No newline at end of file