diff --git a/mod/admin.php b/mod/admin.php index 8a5ec1f1a..f5bd1d4f5 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -548,15 +548,17 @@ function admin_page_federation(App $a) ); $counts = array(); $total = 0; + $users = 0; foreach ($platforms as $p) { // get a total count for the platform, the name and version of the // highest version and the protocol tpe - $c = q('SELECT COUNT(*) AS `total`, ANY_VALUE(`platform`) AS `platform`, + $c = q('SELECT COUNT(*) AS `total`, SUM(`registered-users`) AS `users`, ANY_VALUE(`platform`) AS `platform`, ANY_VALUE(`network`) AS `network`, MAX(`version`) AS `version` FROM `gserver` WHERE `platform` LIKE "%s" AND `last_contact` >= `last_failure` ORDER BY `version` ASC;', $p); - $total = $total + $c[0]['total']; + $total += $c[0]['total']; + $users += $c[0]['users']; // what versions for that platform do we know at all? // again only the active nodes @@ -648,7 +650,7 @@ function admin_page_federation(App $a) '$autoactive' => Config::get('system', 'poco_completion'), '$counts' => $counts, '$version' => FRIENDICA_VERSION, - '$legendtext' => sprintf(t('Currently this node is aware of %d nodes from the following platforms:'), $total), + '$legendtext' => sprintf(t('Currently this node is aware of %d nodes with %d registered users from the following platforms:'), $total, $users), '$baseurl' => System::baseUrl(), )); } diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index 6a017120a..aee7b2f77 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -909,6 +909,11 @@ class PortableContact if (!$failure) { // This will be too low, but better than no value at all. $registered_users = dba::count('gcontact', ['server_url' => normalise_link($server_url)]); + + // Every server has got an admin account at least + if ($registered_users == 0) { + $registered_users = 1; + } } // Look for poco diff --git a/view/templates/admin/federation.tpl b/view/templates/admin/federation.tpl index ee33df09b..6904be6b9 100644 --- a/view/templates/admin/federation.tpl +++ b/view/templates/admin/federation.tpl @@ -10,7 +10,7 @@