Only display federated servers

This commit is contained in:
Michael 2022-02-06 05:58:37 +00:00
parent 650f90df25
commit 585af09b7d

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Admin; namespace Friendica\Module\Admin;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
@ -72,15 +73,15 @@ class Federation extends BaseAdmin
$gservers = DBA::p("SELECT COUNT(*) AS `total`, SUM(`registered-users`) AS `users`, `platform`, $gservers = DBA::p("SELECT COUNT(*) AS `total`, SUM(`registered-users`) AS `users`, `platform`,
ANY_VALUE(`network`) AS `network`, MAX(`version`) AS `version` ANY_VALUE(`network`) AS `network`, MAX(`version`) AS `version`
FROM `gserver` WHERE NOT `failed` AND `detection-method` != ? GROUP BY `platform`", GServer::DETECT_MANUAL); FROM `gserver` WHERE NOT `failed` AND `detection-method` != ? AND NOT `network` IN (?, ?) GROUP BY `platform`", GServer::DETECT_MANUAL, Protocol::PHANTOM, Protocol::FEED);
while ($gserver = DBA::fetch($gservers)) { while ($gserver = DBA::fetch($gservers)) {
$total += $gserver['total']; $total += $gserver['total'];
$users += $gserver['users']; $users += $gserver['users'];
$versionCounts = []; $versionCounts = [];
$versions = DBA::p("SELECT COUNT(*) AS `total`, `version` FROM `gserver` $versions = DBA::p("SELECT COUNT(*) AS `total`, `version` FROM `gserver`
WHERE NOT `failed` AND `platform` = ? AND `detection-method` != ? WHERE NOT `failed` AND `platform` = ? AND `detection-method` != ? AND NOT `network` IN (?, ?)
GROUP BY `version` ORDER BY `version`", $gserver['platform'], GServer::DETECT_MANUAL); GROUP BY `version` ORDER BY `version`", $gserver['platform'], GServer::DETECT_MANUAL, Protocol::PHANTOM, Protocol::FEED);
while ($version = DBA::fetch($versions)) { while ($version = DBA::fetch($versions)) {
$version['version'] = str_replace(["\n", "\r", "\t"], " ", $version['version']); $version['version'] = str_replace(["\n", "\r", "\t"], " ", $version['version']);