Merge branch 'Bramas-master' into develop
This commit is contained in:
commit
c46ca81a97
@ -103,6 +103,12 @@ else echo $error;
|
|||||||
echo(PHP_EOL . PHP_EOL . 'System Information' . PHP_EOL);
|
echo(PHP_EOL . PHP_EOL . 'System Information' . PHP_EOL);
|
||||||
echo('------------------' . PHP_EOL);
|
echo('------------------' . PHP_EOL);
|
||||||
|
|
||||||
|
# Ensure that user is logged in
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
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 = file_get_contents(LYCHEE_SRC . 'package.json');
|
||||||
$json = json_decode($json, true);
|
$json = json_decode($json, true);
|
||||||
@ -126,4 +132,12 @@ echo('Imagick Version: ' . $imagickVersion . PHP_EOL);
|
|||||||
echo('GD Version: ' . $gdVersion['GD Version'] . PHP_EOL);
|
echo('GD Version: ' . $gdVersion['GD Version'] . PHP_EOL);
|
||||||
echo('Plugins: ' . $settings['plugins'] . PHP_EOL);
|
echo('Plugins: ' . $settings['plugins'] . PHP_EOL);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
# Don't go further if the user is not logged in
|
||||||
|
echo('You have to be logged in to see more information.');
|
||||||
|
exit();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -37,6 +37,16 @@ if (mysqli_connect_errno()!=0) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Load settings
|
||||||
|
$settings = new Settings($database);
|
||||||
|
$settings = $settings->get();
|
||||||
|
|
||||||
|
# Ensure that user is logged in
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
if ((isset($_SESSION['login'])&&$_SESSION['login']===true)&&
|
||||||
|
(isset($_SESSION['identifier'])&&$_SESSION['identifier']===$settings['identifier'])) {
|
||||||
|
|
||||||
# Result
|
# Result
|
||||||
$query = Database::prepare($database, "SELECT FROM_UNIXTIME(time), type, function, line, text FROM ?", array(LYCHEE_TABLE_LOG));
|
$query = Database::prepare($database, "SELECT FROM_UNIXTIME(time), type, function, line, text FROM ?", array(LYCHEE_TABLE_LOG));
|
||||||
$result = $database->query($query);
|
$result = $database->query($query);
|
||||||
@ -44,20 +54,28 @@ $result = $database->query($query);
|
|||||||
# Output
|
# Output
|
||||||
if ($result->num_rows===0) {
|
if ($result->num_rows===0) {
|
||||||
|
|
||||||
echo('Everything looks fine, Lychee has not reported any problems!' . PHP_EOL . PHP_EOL);
|
echo('Everything looks fine, Lychee has not reported any problems!');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
while($row = $result->fetch_row()) {
|
while($row = $result->fetch_row()) {
|
||||||
|
|
||||||
# Encode result before printing
|
# Encode result before printing
|
||||||
$row = array_map("htmlentities", $row);
|
$row = array_map('htmlentities', $row);
|
||||||
|
|
||||||
# Format: time TZ - type - function(line) - text
|
# Format: time TZ - type - function(line) - text
|
||||||
printf ("%s %s - %s - %s (%s) \t- %s\n", $row[0], date_default_timezone_get(), $row[1], $row[2], $row[3], $row[4]);
|
printf ("%s - %s - %s (%s) \t- %s\n", $row[0], $row[1], $row[2], $row[3], $row[4]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
# Don't go further if the user is not logged in
|
||||||
|
echo('You have to be logged in to see the log.');
|
||||||
|
exit();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user