Commit dfcb51f9 authored by noplanman's avatar noplanman

Small code improvements and warning fixes.

parent 27b4991b
......@@ -10,9 +10,7 @@ use RedBeanPHP\R;
require_once __DIR__ . '/../boot.php';
if (!($_domain = $_GET['domain'] ?? null)) {
die('no pod domain given');
}
($_domain = $_GET['domain'] ?? null) || die('no pod domain given');
// Other parameters.
$_email = $_GET['email'] ?? '';
......@@ -33,6 +31,7 @@ try {
die('Error in SQL query: ' . $e->getMessage());
}
$stop = false;
foreach ($pods as $pod) {
if ($pod['domain'] === $_domain) {
if ($pod['email']) {
......@@ -75,12 +74,11 @@ foreach ($pods as $pod) {
</form>
EOF;
$stop = 1;
$stop = true;
}
}
if (!$stop) {
$link = 'https://' . $_domain . '/nodeinfo/1.0';
if ($infos = file_get_contents('https://' . $_domain . '/.well-known/nodeinfo')) {
$info = json_decode($infos, true);
......
......@@ -5,20 +5,22 @@
*/
declare(strict_types=1);
use Carbon\Carbon;
require_once __DIR__ . '/boot.php';
$lastfile = 'db/last.data';
$input = isset($_GET['input']) ? substr($_GET['input'], 1) : null;
$mapview = isset($_GET['mapview']) || $input == 'map';
$statsview = isset($_GET['statsview']) || $input == 'stats';
$podmin = isset($_GET['podmin']) || $input == 'podmin';
$podminedit = isset($_GET['podminedit']) || $input == 'podminedit';
$edit = isset($_GET['edit']) || $input == 'edit';
$add = isset($_GET['add']) || $input == 'add';
$gettoken = isset($_GET['gettoken']) || $input == 'gettoken';
$mapview = isset($_GET['mapview']) || $input === 'map';
$statsview = isset($_GET['statsview']) || $input === 'stats';
$podmin = isset($_GET['podmin']) || $input === 'podmin';
$podminedit = isset($_GET['podminedit']) || $input === 'podminedit';
$edit = isset($_GET['edit']) || $input === 'edit';
$add = isset($_GET['add']) || $input === 'add';
$gettoken = isset($_GET['gettoken']) || $input === 'gettoken';
$simpleview = !($mapview || $podmin || $podminedit || $statsview);
$fullview = false;
?>
<!doctype html>
<html lang="en">
......@@ -128,7 +130,7 @@ $navs = [
include_once __DIR__ . '/db/gettoken.php';
} else {
include_once __DIR__ . '/showfull.php';
$fullview = 1;
$fullview = true;
}
?>
</div>
......@@ -147,9 +149,7 @@ $navs = [
<script src="node_modules/ion-rangeslider/js/ion.rangeSlider.min.js"></script>
<?php
$statsview && include_once __DIR__ . '/statsviewjs.php';
if ($fullview) {
echo '<script src="js/podup.js"></script>';
}
$fullview && printf('<script src="js/podup.js"></script>');
?>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment