diff --git a/db/add.php b/db/add.php index f71cb8eb4ad5a67801c0d904afc416960df15e29..21e49734eb61ea3ad8b9547ab57162dcd7f30dad 100644 --- a/db/add.php +++ b/db/add.php @@ -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) { 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); @@ -103,12 +101,12 @@ if (!$stop) { $publickey = md5(uniqid($_domain, true)); try { - $p = R::dispense('pods'); - $p['domain'] = $_domain; - $p['email'] = $_email; + $p = R::dispense('pods'); + $p['domain'] = $_domain; + $p['email'] = $_email; $p['podmin_statement'] = $_podmin_statement; - $p['podmin_notify'] = $_podmin_notify; - $p['publickey'] = $publickey; + $p['podmin_notify'] = $_podmin_notify; + $p['publickey'] = $publickey; R::store($p); } catch (\RedBeanPHP\RedException $e) { diff --git a/db/edit.php b/db/edit.php index d29ef1e26f69b5c803e6c0e562421ac068311ced..5b2218022b1103e1fba1a7daeace7a09c26fb3b0 100644 --- a/db/edit.php +++ b/db/edit.php @@ -143,4 +143,4 @@ Authorized to edit for "/> Do a debug pull of your pod. Won't update the database just show what it would look like on a pass. - \ No newline at end of file + diff --git a/index.php b/index.php index b86c16d957ecdf07d869f1a2bbd392500272c54d..a8d05ddddbba1ce3454c8a14d250e9705119e13e 100644 --- a/index.php +++ b/index.php @@ -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'; -$simpleview = !($mapview || $podmin || $podminedit || $statsview); +$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'; +$simpleview = !($mapview || $podmin || $podminedit || $statsview); +$fullview = false; ?> @@ -67,16 +69,16 @@ $navs = [

About

Poduptime helps you find a diaspora, friendica, hubzilla or socialhome pod to use and join the federated social network.

@@ -128,7 +130,7 @@ $navs = [ include_once __DIR__ . '/db/gettoken.php'; } else { include_once __DIR__ . '/showfull.php'; - $fullview = 1; + $fullview = true; } ?>
@@ -147,9 +149,7 @@ $navs = [ '; -} +$fullview && printf(''); ?>