Merge pull request #13851 from annando/account-overview

The account overview is now grouped by the account type
This commit is contained in:
Hypolite Petovan 2024-01-24 14:49:14 -05:00 committed by GitHub
commit b3e4b9675a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 47 deletions

View file

@ -48,24 +48,23 @@ class Summary extends BaseModeration
protected function content(array $request = []): string protected function content(array $request = []): string
{ {
parent::content(); parent::content();
$accounts = [ $accounts = [
[$this->t('Normal Account'), 0], [$this->t('Personal Page'), 0],
[$this->t('Automatic Follower Account'), 0], [$this->t('Organisation Page'), 0],
[$this->t('Public Group Account'), 0], [$this->t('News Page'), 0],
[$this->t('Automatic Friend Account'), 0], [$this->t('Community Group'), 0],
[$this->t('Blog Account'), 0], [$this->t('Channel Relay'), 0],
[$this->t('Private Group Account'), 0]
]; ];
$users = 0; $users = 0;
$pageFlagsCountStmt = $this->database->p('SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `page-flags`', 0); $accountTypeCountStmt = $this->database->p('SELECT `account-type`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `account-type`', 0);
while ($pageFlagsCount = $this->database->fetch($pageFlagsCountStmt)) { while ($AccountTypeCount = $this->database->fetch($accountTypeCountStmt)) {
$accounts[$pageFlagsCount['page-flags']][1] = $pageFlagsCount['count']; $accounts[$AccountTypeCount['account-type']][1] = $AccountTypeCount['count'];
$users += $pageFlagsCount['count']; $users += $AccountTypeCount['count'];
} }
$this->database->close($pageFlagsCountStmt); $this->database->close($accountTypeCountStmt);
$this->logger->debug('accounts', ['accounts' => $accounts]); $this->logger->debug('accounts', ['accounts' => $accounts]);

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2024.03-dev\n" "Project-Id-Version: 2024.03-dev\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-01-20 14:09+0000\n" "POT-Creation-Date: 2024-01-23 22:10+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -2136,7 +2136,7 @@ msgstr ""
#: src/Module/Moderation/Blocklist/Server/Import.php:118 #: src/Module/Moderation/Blocklist/Server/Import.php:118
#: src/Module/Moderation/Blocklist/Server/Index.php:95 #: src/Module/Moderation/Blocklist/Server/Index.php:95
#: src/Module/Moderation/Item/Delete.php:61 #: src/Module/Moderation/Item/Delete.php:61
#: src/Module/Moderation/Reports.php:89 src/Module/Moderation/Summary.php:76 #: src/Module/Moderation/Reports.php:89 src/Module/Moderation/Summary.php:75
#: src/Module/Moderation/Users/Active.php:133 #: src/Module/Moderation/Users/Active.php:133
#: src/Module/Moderation/Users/Blocked.php:133 #: src/Module/Moderation/Users/Blocked.php:133
#: src/Module/Moderation/Users/Deleted.php:80 #: src/Module/Moderation/Users/Deleted.php:80
@ -3615,7 +3615,7 @@ msgstr ""
#: src/Model/Profile.php:1043 src/Module/Admin/Summary.php:197 #: src/Model/Profile.php:1043 src/Module/Admin/Summary.php:197
#: src/Module/Moderation/Report/Create.php:280 #: src/Module/Moderation/Report/Create.php:280
#: src/Module/Moderation/Summary.php:77 #: src/Module/Moderation/Summary.php:76
msgid "Summary" msgid "Summary"
msgstr "" msgstr ""
@ -7855,19 +7855,23 @@ msgstr ""
msgid "Private Group" msgid "Private Group"
msgstr "" msgstr ""
#: src/Module/Moderation/BaseUsers.php:126 src/Module/Settings/Account.php:453 #: src/Module/Moderation/BaseUsers.php:126 src/Module/Moderation/Summary.php:53
#: src/Module/Settings/Account.php:453
msgid "Personal Page" msgid "Personal Page"
msgstr "" msgstr ""
#: src/Module/Moderation/BaseUsers.php:127 src/Module/Settings/Account.php:460 #: src/Module/Moderation/BaseUsers.php:127 src/Module/Moderation/Summary.php:54
#: src/Module/Settings/Account.php:460
msgid "Organisation Page" msgid "Organisation Page"
msgstr "" msgstr ""
#: src/Module/Moderation/BaseUsers.php:128 src/Module/Settings/Account.php:467 #: src/Module/Moderation/BaseUsers.php:128 src/Module/Moderation/Summary.php:55
#: src/Module/Settings/Account.php:467
msgid "News Page" msgid "News Page"
msgstr "" msgstr ""
#: src/Module/Moderation/BaseUsers.php:129 src/Module/Settings/Account.php:474 #: src/Module/Moderation/BaseUsers.php:129 src/Module/Moderation/Summary.php:56
#: src/Module/Settings/Account.php:474
msgid "Community Group" msgid "Community Group"
msgstr "" msgstr ""
@ -8511,35 +8515,15 @@ msgstr[1] ""
msgid "URL of the reported contact." msgid "URL of the reported contact."
msgstr "" msgstr ""
#: src/Module/Moderation/Summary.php:53 #: src/Module/Moderation/Summary.php:57 src/Module/Settings/Account.php:431
msgid "Normal Account" msgid "Channel Relay"
msgstr "" msgstr ""
#: src/Module/Moderation/Summary.php:54 #: src/Module/Moderation/Summary.php:77
msgid "Automatic Follower Account"
msgstr ""
#: src/Module/Moderation/Summary.php:55
msgid "Public Group Account"
msgstr ""
#: src/Module/Moderation/Summary.php:56
msgid "Automatic Friend Account"
msgstr ""
#: src/Module/Moderation/Summary.php:57
msgid "Blog Account"
msgstr ""
#: src/Module/Moderation/Summary.php:58
msgid "Private Group Account"
msgstr ""
#: src/Module/Moderation/Summary.php:78
msgid "Registered users" msgid "Registered users"
msgstr "" msgstr ""
#: src/Module/Moderation/Summary.php:80 #: src/Module/Moderation/Summary.php:79
msgid "Pending registrations" msgid "Pending registrations"
msgstr "" msgstr ""
@ -9684,10 +9668,6 @@ msgstr ""
msgid "Unable to find your profile. Please contact your admin." msgid "Unable to find your profile. Please contact your admin."
msgstr "" msgstr ""
#: src/Module/Settings/Account.php:431
msgid "Channel Relay"
msgstr ""
#: src/Module/Settings/Account.php:433 #: src/Module/Settings/Account.php:433
msgid "" msgid ""
"Account for a service that automatically shares content based on user " "Account for a service that automatically shares content based on user "