]> git.mxchange.org Git - friendica.git/commitdiff
New area "moderation"
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 6 Nov 2022 01:01:06 +0000 (21:01 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 8 Nov 2022 07:28:42 +0000 (02:28 -0500)
- Moved several admin pages to the moderation area
- ACL still is checking for administrator credentials

84 files changed:
doc/Accesskeys.md
src/Content/Nav.php
src/Module/Admin/BaseUsers.php [deleted file]
src/Module/Admin/Blocklist/Contact.php [deleted file]
src/Module/Admin/Blocklist/Server/Add.php [deleted file]
src/Module/Admin/Blocklist/Server/Import.php [deleted file]
src/Module/Admin/Blocklist/Server/Index.php [deleted file]
src/Module/Admin/Item/Delete.php [deleted file]
src/Module/Admin/Item/Source.php [deleted file]
src/Module/Admin/Summary.php
src/Module/Admin/Users/Active.php [deleted file]
src/Module/Admin/Users/Blocked.php [deleted file]
src/Module/Admin/Users/Create.php [deleted file]
src/Module/Admin/Users/Deleted.php [deleted file]
src/Module/Admin/Users/Index.php [deleted file]
src/Module/Admin/Users/Pending.php [deleted file]
src/Module/BaseAdmin.php
src/Module/BaseModeration.php [new file with mode: 0644]
src/Module/Moderation/BaseUsers.php [new file with mode: 0644]
src/Module/Moderation/Blocklist/Contact.php [new file with mode: 0644]
src/Module/Moderation/Blocklist/Server/Add.php [new file with mode: 0644]
src/Module/Moderation/Blocklist/Server/Import.php [new file with mode: 0644]
src/Module/Moderation/Blocklist/Server/Index.php [new file with mode: 0644]
src/Module/Moderation/Item/Delete.php [new file with mode: 0644]
src/Module/Moderation/Item/Source.php [new file with mode: 0644]
src/Module/Moderation/Summary.php [new file with mode: 0644]
src/Module/Moderation/Users/Active.php [new file with mode: 0644]
src/Module/Moderation/Users/Blocked.php [new file with mode: 0644]
src/Module/Moderation/Users/Create.php [new file with mode: 0644]
src/Module/Moderation/Users/Deleted.php [new file with mode: 0644]
src/Module/Moderation/Users/Index.php [new file with mode: 0644]
src/Module/Moderation/Users/Pending.php [new file with mode: 0644]
static/routes.config.php
view/templates/admin/blocklist/contact.tpl [deleted file]
view/templates/admin/blocklist/server/add.tpl [deleted file]
view/templates/admin/blocklist/server/import.tpl [deleted file]
view/templates/admin/blocklist/server/index.tpl [deleted file]
view/templates/admin/item/delete.tpl [deleted file]
view/templates/admin/item/source.tpl [deleted file]
view/templates/admin/summary.tpl
view/templates/admin/users/active.tpl [deleted file]
view/templates/admin/users/blocked.tpl [deleted file]
view/templates/admin/users/create.tpl [deleted file]
view/templates/admin/users/deleted.tpl [deleted file]
view/templates/admin/users/index.tpl [deleted file]
view/templates/admin/users/pending.tpl [deleted file]
view/templates/moderation/aside.tpl [new file with mode: 0644]
view/templates/moderation/blocklist/contact.tpl [new file with mode: 0644]
view/templates/moderation/blocklist/server/add.tpl [new file with mode: 0644]
view/templates/moderation/blocklist/server/import.tpl [new file with mode: 0644]
view/templates/moderation/blocklist/server/index.tpl [new file with mode: 0644]
view/templates/moderation/item/delete.tpl [new file with mode: 0644]
view/templates/moderation/item/source.tpl [new file with mode: 0644]
view/templates/moderation/settings_head.tpl [new file with mode: 0644]
view/templates/moderation/summary.tpl [new file with mode: 0644]
view/templates/moderation/users/active.tpl [new file with mode: 0644]
view/templates/moderation/users/blocked.tpl [new file with mode: 0644]
view/templates/moderation/users/create.tpl [new file with mode: 0644]
view/templates/moderation/users/deleted.tpl [new file with mode: 0644]
view/templates/moderation/users/index.tpl [new file with mode: 0644]
view/templates/moderation/users/pending.tpl [new file with mode: 0644]
view/templates/nav.tpl
view/theme/duepuntozero/templates/nav.tpl
view/theme/frio/templates/admin/blocklist/contact.tpl [deleted file]
view/theme/frio/templates/admin/summary.tpl
view/theme/frio/templates/admin/users/active.tpl [deleted file]
view/theme/frio/templates/admin/users/blocked.tpl [deleted file]
view/theme/frio/templates/admin/users/create.tpl [deleted file]
view/theme/frio/templates/admin/users/deleted.tpl [deleted file]
view/theme/frio/templates/admin/users/index.tpl [deleted file]
view/theme/frio/templates/admin/users/pending.tpl [deleted file]
view/theme/frio/templates/moderation/aside.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/blocklist/contact.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/summary.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/users/active.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/users/blocked.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/users/create.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/users/deleted.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/users/index.tpl [new file with mode: 0644]
view/theme/frio/templates/moderation/users/pending.tpl [new file with mode: 0644]
view/theme/frio/templates/nav.tpl
view/theme/quattro/templates/nav.tpl
view/theme/smoothly/templates/nav.tpl
view/theme/vier/templates/nav.tpl

index f79524c1b3b7d7d1c79b56f592c687134c223b00..a94fd1ea968775cfa43cbae63f9657815b020ab8 100644 (file)
@@ -19,6 +19,7 @@ General
 * c - Community
 * s - Search
 * a - Admin
+* m - Moderation
 * f - Notifications
 * u - User menu
 
index 17b6412df29fcde9ba5358bd3a377ceea57c88ce..0000b3d2962f3b35c390d61fb3f0fba195937f41 100644 (file)
@@ -162,6 +162,7 @@ class Nav
 
                $nav = [
                        'admin'         => null,
+                       'moderation'    => null,
                        'apps'          => null,
                        'community'     => null,
                        'home'          => null,
@@ -298,7 +299,8 @@ class Nav
 
                // Show the link to the admin configuration page if user is admin
                if ($a->isSiteAdmin()) {
-                       $nav['admin'] = ['admin/', DI::l10n()->t('Admin'), '', DI::l10n()->t('Site setup and configuration')];
+                       $nav['admin']      = ['admin/', DI::l10n()->t('Admin'), '', DI::l10n()->t('Site setup and configuration')];
+                       $nav['moderation'] = ['moderation/', DI::l10n()->t('Moderation'), '', DI::l10n()->t('Content and user moderation')];
                }
 
                $nav['navigation'] = ['navigation/', DI::l10n()->t('Navigation'), '', DI::l10n()->t('Site map')];
diff --git a/src/Module/Admin/BaseUsers.php b/src/Module/Admin/BaseUsers.php
deleted file mode 100644 (file)
index 93433ef..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin;
-
-use Friendica\Core\Renderer;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\Register;
-use Friendica\Model\User;
-use Friendica\Module\BaseAdmin;
-use Friendica\Util\Temporal;
-
-abstract class BaseUsers extends BaseAdmin
-{
-       /**
-        * Get the users admin tabs menu
-        *
-        * @param string $selectedTab
-        * @return string HTML
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        */
-       protected static function getTabsHTML(string $selectedTab)
-       {
-               $all     = DBA::count('user', ["`uid` != ?", 0]);
-               $active  = DBA::count('user', ["NOT `blocked` AND `verified` AND NOT `account_removed` AND `uid` != ?", 0]);
-               $pending = Register::getPendingCount();
-               $blocked = DBA::count('user', ['blocked' => true, 'verified' => true, 'account_removed' => false]);
-               $deleted = DBA::count('user', ['account_removed' => true]);
-
-               $tabs = [
-                       [
-                               'label' => DI::l10n()->t('All') . ' (' . $all . ')',
-                               'url'   => 'admin/users',
-                               'sel'   => !$selectedTab || $selectedTab == 'all' ? 'active' : '',
-                               'title' => DI::l10n()->t('List of all users'),
-                               'id'    => 'admin-users-all',
-                               'accesskey' => 'a',
-                       ],
-                       [
-                               'label' => DI::l10n()->t('Active') . ' (' . $active . ')',
-                               'url'   => 'admin/users/active',
-                               'sel'   => $selectedTab == 'active' ? 'active' : '',
-                               'title' => DI::l10n()->t('List of active accounts'),
-                               'id'    => 'admin-users-active',
-                               'accesskey' => 'k',
-                       ],
-                       [
-                               'label' => DI::l10n()->t('Pending') . ($pending ? ' (' . $pending . ')' : ''),
-                               'url'   => 'admin/users/pending',
-                               'sel'   => $selectedTab == 'pending' ? 'active' : '',
-                               'title' => DI::l10n()->t('List of pending registrations'),
-                               'id'    => 'admin-users-pending',
-                               'accesskey' => 'p',
-                       ],
-                       [
-                               'label' => DI::l10n()->t('Blocked') . ($blocked ? ' (' . $blocked . ')' : ''),
-                               'url'   => 'admin/users/blocked',
-                               'sel'   => $selectedTab == 'blocked' ? 'active' : '',
-                               'title' => DI::l10n()->t('List of blocked users'),
-                               'id'    => 'admin-users-blocked',
-                               'accesskey' => 'b',
-                       ],
-                       [
-                               'label' => DI::l10n()->t('Deleted') . ($deleted ? ' (' . $deleted . ')' : ''),
-                               'url'   => 'admin/users/deleted',
-                               'sel'   => $selectedTab == 'deleted' ? 'active' : '',
-                               'title' => DI::l10n()->t('List of pending user deletions'),
-                               'id'    => 'admin-users-deleted',
-                               'accesskey' => 'd',
-                       ],
-               ];
-
-               $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
-               return Renderer::replaceMacros($tpl, ['$tabs' => $tabs]);
-       }
-
-       protected static function setupUserCallback() {
-               $adminlist = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
-               return function ($user) use ($adminlist) {
-                       $page_types = [
-                               User::PAGE_FLAGS_NORMAL    => DI::l10n()->t('Normal Account Page'),
-                               User::PAGE_FLAGS_SOAPBOX   => DI::l10n()->t('Soapbox Page'),
-                               User::PAGE_FLAGS_COMMUNITY => DI::l10n()->t('Public Forum'),
-                               User::PAGE_FLAGS_FREELOVE  => DI::l10n()->t('Automatic Friend Page'),
-                               User::PAGE_FLAGS_PRVGROUP  => DI::l10n()->t('Private Forum')
-                       ];
-                       $account_types = [
-                               User::ACCOUNT_TYPE_PERSON       => DI::l10n()->t('Personal Page'),
-                               User::ACCOUNT_TYPE_ORGANISATION => DI::l10n()->t('Organisation Page'),
-                               User::ACCOUNT_TYPE_NEWS         => DI::l10n()->t('News Page'),
-                               User::ACCOUNT_TYPE_COMMUNITY    => DI::l10n()->t('Community Forum'),
-                               User::ACCOUNT_TYPE_RELAY        => DI::l10n()->t('Relay'),
-                       ];
-
-                       $user['page_flags_raw'] = $user['page-flags'];
-                       $user['page_flags'] = $page_types[$user['page-flags']];
-
-                       $user['account_type_raw'] = ($user['page_flags_raw'] == 0) ? $user['account-type'] : -1;
-                       $user['account_type'] = ($user['page_flags_raw'] == 0) ? $account_types[$user['account-type']] : '';
-
-                       $user['register_date'] = Temporal::getRelativeDate($user['register_date']);
-                       $user['login_date'] = Temporal::getRelativeDate($user['login_date']);
-                       $user['lastitem_date'] = Temporal::getRelativeDate($user['last-item']);
-                       $user['is_admin'] = in_array($user['email'], $adminlist);
-                       $user['is_deletable'] = !$user['account_removed'] && intval($user['uid']) != DI::userSession()->getLocalUserId();
-                       $user['deleted'] = ($user['account_removed'] ? Temporal::getRelativeDate($user['account_expires_on']) : False);
-
-                       return $user;
-               };
-       }
-}
diff --git a/src/Module/Admin/Blocklist/Contact.php b/src/Module/Admin/Blocklist/Contact.php
deleted file mode 100644 (file)
index 85e7f21..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Blocklist;
-
-use Friendica\Content\Pager;
-use Friendica\Core\Renderer;
-use Friendica\Core\Worker;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model;
-use Friendica\Module\BaseAdmin;
-use Friendica\Util\Network;
-
-class Contact extends BaseAdmin
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/blocklist/contact', 'admin_contactblock');
-
-               $contact_url  = $_POST['contact_url'] ?? '';
-               $block_reason = $_POST['contact_block_reason'] ?? '';
-               $block_purge  = $_POST['contact_block_purge'] ?? false;
-               $contacts     = $_POST['contacts'] ?? [];
-
-               if (!empty($_POST['page_contactblock_block'])) {
-                       $contact = Model\Contact::getByURL($contact_url, null, ['id', 'nurl']);
-                       if (empty($contact)) {
-                               DI::sysmsg()->addNotice(DI::l10n()->t('Could not find any contact entry for this URL (%s)', $contact_url));
-                               DI::baseUrl()->redirect('admin/blocklist/contact');
-                       }
-
-                       if (Network::isLocalLink($contact['nurl'])) {
-                               DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t block a local contact, please block the user instead'));
-                               DI::baseUrl()->redirect('admin/blocklist/contact');
-                       }
-
-                       Model\Contact::block($contact['id'], $block_reason);
-
-                       if ($block_purge) {
-                               foreach (Model\Contact::selectToArray(['id'], ['nurl' => $contact['nurl']]) as $contact) {
-                                       Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
-                               }
-                       }
-
-                       DI::sysmsg()->addInfo(DI::l10n()->t('The contact has been blocked from the node'));
-               }
-
-               if (!empty($_POST['page_contactblock_unblock'])) {
-                       foreach ($contacts as $uid) {
-                               Model\Contact::unblock($uid);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
-               }
-
-               DI::baseUrl()->redirect('admin/blocklist/contact');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $condition = ['uid' => 0, 'blocked' => true];
-
-               $total = DBA::count('contact', $condition);
-
-               $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 30);
-
-               $contacts = Model\Contact::selectToArray([], $condition, ['limit' => [$pager->getStart(), $pager->getItemsPerPage()]]);
-
-               $t = Renderer::getMarkupTemplate('admin/blocklist/contact.tpl');
-               $o = Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title'       => DI::l10n()->t('Administration'),
-                       '$page'        => DI::l10n()->t('Remote Contact Blocklist'),
-                       '$description' => DI::l10n()->t('This page allows you to prevent any message from a remote contact to reach your node.'),
-                       '$submit'      => DI::l10n()->t('Block Remote Contact'),
-                       '$select_all'  => DI::l10n()->t('select all'),
-                       '$select_none' => DI::l10n()->t('select none'),
-                       '$block'       => DI::l10n()->t('Block'),
-                       '$unblock'     => DI::l10n()->t('Unblock'),
-                       '$no_data'     => DI::l10n()->t('No remote contact is blocked from this node.'),
-
-                       '$h_contacts'  => DI::l10n()->t('Blocked Remote Contacts'),
-                       '$h_newblock'  => DI::l10n()->t('Block New Remote Contact'),
-                       '$th_contacts' => [DI::l10n()->t('Photo'), DI::l10n()->t('Name'), DI::l10n()->t('Reason')],
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_contactblock'),
-
-                       // values //
-                       '$baseurl'    => DI::baseUrl()->get(true),
-
-                       '$contacts'   => $contacts,
-                       '$total_contacts' => DI::l10n()->tt('%s total blocked contact', '%s total blocked contacts', $total),
-                       '$paginate'   => $pager->renderFull($total),
-                       '$contacturl' => ['contact_url', DI::l10n()->t('Profile URL'), '', DI::l10n()->t('URL of the remote contact to block.')],
-                       '$contact_block_purge'  => ['contact_block_purge', DI::l10n()->t('Also purge contact'), false, DI::l10n()->t('Removes all content related to this contact from the node. Keeps the contact record. This action cannot be undone.')],
-                       '$contact_block_reason' => ['contact_block_reason', DI::l10n()->t('Block Reason')],
-               ]);
-               return $o;
-       }
-}
diff --git a/src/Module/Admin/Blocklist/Server/Add.php b/src/Module/Admin/Blocklist/Server/Add.php
deleted file mode 100644 (file)
index f060bcd..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Blocklist\Server;
-
-use Friendica\App;
-use Friendica\Content\ContactSelector;
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Core\Worker;
-use Friendica\Model\Contact;
-use Friendica\Model\GServer;
-use Friendica\Moderation\DomainPatternBlocklist;
-use Friendica\Module\BaseAdmin;
-use Friendica\Module\Response;
-use Friendica\Navigation\SystemMessages;
-use Friendica\Util\Profiler;
-use GuzzleHttp\Psr7\Uri;
-use Psr\Log\LoggerInterface;
-
-class Add extends BaseAdmin
-{
-       /** @var SystemMessages */
-       private $sysmsg;
-
-       /** @var DomainPatternBlocklist */
-       private $blocklist;
-
-       public function __construct(SystemMessages $sysmsg, DomainPatternBlocklist $blocklist, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
-       {
-               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
-
-               $this->sysmsg    = $sysmsg;
-               $this->blocklist = $blocklist;
-       }
-
-       /**
-        * @param array $request
-        * @return void
-        * @throws \Friendica\Network\HTTPException\ForbiddenException
-        * @throws \Friendica\Network\HTTPException\FoundException
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        * @throws \Friendica\Network\HTTPException\MovedPermanentlyException
-        * @throws \Friendica\Network\HTTPException\TemporaryRedirectException
-        * @throws \Exception
-        */
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               if (empty($request['page_blocklist_add'])) {
-                       return;
-               }
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/blocklist/server/add', 'admin_blocklist_add');
-
-               $pattern = trim($request['pattern']);
-
-               //  Add new item to blocklist
-               $this->blocklist->addPattern($pattern, trim($request['reason']));
-
-               $this->sysmsg->addInfo($this->l10n->t('Server domain pattern added to the blocklist.'));
-
-               if (!empty($request['purge'])) {
-                       $gservers = GServer::listByDomainPattern($pattern);
-                       foreach (Contact::selectToArray(['id'], ['gsid' => array_column($gservers, 'id')]) as $contact) {
-                               Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
-                       }
-
-                       $this->sysmsg->addInfo($this->l10n->tt('%s server scheduled to be purged.', '%s servers scheduled to be purged.', count($gservers)));
-               }
-
-               $this->baseUrl->redirect('admin/blocklist/server');
-       }
-
-       /**
-        * @param array $request
-        * @return string
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        * @throws \Friendica\Network\HTTPException\ServiceUnavailableException
-        * @throws \Exception
-        */
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $gservers = [];
-
-               if ($pattern = trim($request['pattern'] ?? '')) {
-                       $gservers = GServer::listByDomainPattern($pattern);
-               }
-
-               array_walk($gservers, function (array &$gserver) {
-                       $gserver['domain'] = (new Uri($gserver['url']))->getHost();
-                       $gserver['network_icon'] = ContactSelector::networkToIcon($gserver['network']);
-                       $gserver['network_name'] = ContactSelector::networkToName($gserver['network']);
-               });
-
-               $t = Renderer::getMarkupTemplate('admin/blocklist/server/add.tpl');
-               return Renderer::replaceMacros($t, [
-                       '$l10n' => [
-                               'return_list' => $this->l10n->t('← Return to the list'),
-                               'title'       => $this->l10n->t('Administration'),
-                               'page'        => $this->l10n->t('Block A New Server Domain Pattern'),
-                               'syntax'      => $this->l10n->t('<p>The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:</p>
-<ul>
-       <li><code>*</code>: Any number of characters</li>
-       <li><code>?</code>: Any single character</li>
-</ul>'),
-                               'submit'           => $this->l10n->t('Check pattern'),
-                               'matching_servers' => $this->l10n->t('Matching known servers'),
-                               'server_name'      => $this->l10n->t('Server Name'),
-                               'server_domain'    => $this->l10n->t('Server Domain'),
-                               'known_contacts'   => $this->l10n->t('Known Contacts'),
-                               'server_count'     => $this->l10n->tt('%d known server', '%d known servers', count($gservers)),
-                               'add_pattern'      => $this->l10n->t('Add pattern to the blocklist'),
-                       ],
-                       '$newdomain'           => ['pattern', $this->l10n->t('Server Domain Pattern'), $pattern, $this->l10n->t('The domain pattern of the new server to add to the blocklist. Do not include the protocol.'), $this->l10n->t('Required'), '', ''],
-                       '$newpurge'            => ['purge', $this->l10n->t('Purge server'), $request['purge'] ?? false, $this->l10n->tt('Also purges all the locally stored content authored by the known contacts registered on that server. Keeps the contacts and the server records. This action cannot be undone.', 'Also purges all the locally stored content authored by the known contacts registered on these servers. Keeps the contacts and the servers records. This action cannot be undone.', count($gservers))],
-                       '$newreason'           => ['reason', $this->l10n->t('Block reason'), $request['reason'] ?? '', $this->l10n->t('The reason why you blocked this server domain pattern. This reason will be shown publicly in the server information page.'), $this->l10n->t('Required'), '', ''],
-                       '$pattern'             => $pattern,
-                       '$gservers'            => $gservers,
-                       '$baseurl'             => $this->baseUrl->get(true),
-                       '$form_security_token' => self::getFormSecurityToken('admin_blocklist_add')
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Blocklist/Server/Import.php b/src/Module/Admin/Blocklist/Server/Import.php
deleted file mode 100644 (file)
index 166f248..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Blocklist\Server;
-
-use Friendica\App;
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Moderation\DomainPatternBlocklist;
-use Friendica\Module\Response;
-use Friendica\Navigation\SystemMessages;
-use Friendica\Util\Profiler;
-use Psr\Log\LoggerInterface;
-
-class Import extends \Friendica\Module\BaseAdmin
-{
-       /** @var DomainPatternBlocklist */
-       private $localBlocklist;
-
-       /** @var SystemMessages */
-       private $sysmsg;
-
-       /** @var array of blocked server domain patterns */
-       private $blocklist = [];
-
-       public function __construct(DomainPatternBlocklist $localBlocklist, SystemMessages $sysmsg, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
-       {
-               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
-
-               $this->localBlocklist = $localBlocklist;
-               $this->sysmsg = $sysmsg;
-       }
-
-       /**
-        * @param array $request
-        * @return void
-        * @throws \Friendica\Network\HTTPException\ForbiddenException
-        * @throws \Friendica\Network\HTTPException\FoundException
-        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
-        * @throws \Friendica\Network\HTTPException\MovedPermanentlyException
-        * @throws \Friendica\Network\HTTPException\TemporaryRedirectException
-        */
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               if (!isset($request['page_blocklist_upload']) && !isset($request['page_blocklist_import'])) {
-                       return;
-               }
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/blocklist/server/import', 'admin_blocklist_import');
-
-               if (isset($request['page_blocklist_upload'])) {
-                       try {
-                               $this->blocklist = $this->localBlocklist::extractFromCSVFile($_FILES['listfile']['tmp_name']);
-                       } catch (\Throwable $e) {
-                               $this->sysmsg->addNotice($this->l10n->t('Error importing pattern file'));
-                       }
-
-                       return;
-               }
-
-               if (isset($request['page_blocklist_import'])) {
-                       $blocklist = json_decode($request['blocklist'], true);
-                       if ($blocklist === null) {
-                               $this->sysmsg->addNotice($this->l10n->t('Error importing pattern file'));
-                               return;
-                       }
-
-                       if (($request['mode'] ?? 'append') == 'replace') {
-                               $this->localBlocklist->set($blocklist);
-                               $this->sysmsg->addNotice($this->l10n->t('Local blocklist replaced with the provided file.'));
-                       } else {
-                               $count = $this->localBlocklist->append($blocklist);
-                               if ($count) {
-                                       $this->sysmsg->addNotice($this->l10n->tt('%d pattern was added to the local blocklist.', '%d patterns were added to the local blocklist.', $count));
-                               } else {
-                                       $this->sysmsg->addNotice($this->l10n->t('No pattern was added to the local blocklist.'));
-                               }
-                       }
-
-                       $this->baseUrl->redirect('/admin/blocklist/server');
-               }
-       }
-
-       /**
-        * @param array $request
-        * @return string
-        * @throws \Friendica\Network\HTTPException\ServiceUnavailableException
-        */
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $t = Renderer::getMarkupTemplate('admin/blocklist/server/import.tpl');
-               return Renderer::replaceMacros($t, [
-                       '$l10n' => [
-                               'return_list'    => $this->l10n->t('← Return to the list'),
-                               'title'          => $this->l10n->t('Administration'),
-                               'page'           => $this->l10n->t('Import a Server Domain Pattern Blocklist'),
-                               'download'       => $this->l10n->t('<p>This file can be downloaded from the <code>/friendica</code> path of any Friendica server.</p>'),
-                               'upload'         => $this->l10n->t('Upload file'),
-                               'patterns'       => $this->l10n->t('Patterns to import'),
-                               'domain_pattern' => $this->l10n->t('Domain Pattern'),
-                               'block_reason'   => $this->l10n->t('Block Reason'),
-                               'mode'           => $this->l10n->t('Import Mode'),
-                               'import'         => $this->l10n->t('Import Patterns'),
-                               'pattern_count'  => $this->l10n->tt('%d total pattern', '%d total patterns', count($this->blocklist)),
-                       ],
-                       '$listfile'            => ['listfile', $this->l10n->t('Server domain pattern blocklist CSV file'), '', '', $this->l10n->t('Required'), '', 'file'],
-                       '$mode_append'         => ['mode', $this->l10n->t('Append'), 'append', $this->l10n->t('Imports patterns from the file that weren\'t already existing in the current blocklist.'), 'checked="checked"'],
-                       '$mode_replace'        => ['mode', $this->l10n->t('Replace'), 'replace', $this->l10n->t('Replaces the current blocklist by the imported patterns.')],
-                       '$blocklist'           => $this->blocklist,
-                       '$baseurl'             => $this->baseUrl->get(true),
-                       '$form_security_token' => self::getFormSecurityToken('admin_blocklist_import')
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Blocklist/Server/Index.php b/src/Module/Admin/Blocklist/Server/Index.php
deleted file mode 100644 (file)
index a4884ca..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Blocklist\Server;
-
-use Friendica\App;
-use Friendica\Core\Config\Capability\IManageConfigValues;
-use Friendica\Core\L10n;
-use Friendica\Core\Renderer;
-use Friendica\Moderation\DomainPatternBlocklist;
-use Friendica\Module\BaseAdmin;
-use Friendica\Module\Response;
-use Friendica\Util\Profiler;
-use Psr\Log\LoggerInterface;
-
-class Index extends BaseAdmin
-{
-       /** @var DomainPatternBlocklist */
-       private $blocklist;
-
-       public function __construct(DomainPatternBlocklist $blocklist, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
-       {
-               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
-
-               $this->blocklist = $blocklist;
-       }
-
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               if (empty($request['page_blocklist_edit'])) {
-                       return;
-               }
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/blocklist/server', 'admin_blocklist');
-
-               // Edit the entries from blocklist
-               $blocklist = [];
-               foreach ($request['domain'] as $id => $domain) {
-                       // Trimming whitespaces as well as any lingering slashes
-                       $domain = trim($domain);
-                       $reason = trim($request['reason'][$id]);
-                       if (empty($request['delete'][$id])) {
-                               $blocklist[] = [
-                                       'domain' => $domain,
-                                       'reason' => $reason
-                               ];
-                       }
-               }
-
-               $this->blocklist->set($blocklist);
-
-               $this->baseUrl->redirect('admin/blocklist/server');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $blocklistform = [];
-               foreach ($this->blocklist->get() as $id => $b) {
-                       $blocklistform[] = [
-                               'domain' => ["domain[$id]", $this->l10n->t('Blocked server domain pattern'), $b['domain'], '', $this->l10n->t('Required'), '', ''],
-                               'reason' => ["reason[$id]", $this->l10n->t("Reason for the block"), $b['reason'], '', $this->l10n->t('Required'), '', ''],
-                               'delete' => ["delete[$id]", $this->l10n->t("Delete server domain pattern") . ' (' . $b['domain'] . ')', false, $this->l10n->t("Check to delete this entry from the blocklist")]
-                       ];
-               }
-
-               $t = Renderer::getMarkupTemplate('admin/blocklist/server/index.tpl');
-               return Renderer::replaceMacros($t, [
-                       '$l10n' => [
-                               'title'  => $this->l10n->t('Administration'),
-                               'page'   => $this->l10n->t('Server Domain Pattern Blocklist'),
-                               'intro'  => $this->l10n->t('This page can be used to define a blocklist of server domain patterns from the federated network that are not allowed to interact with your node. For each domain pattern you should also provide the reason why you block it.'),
-                               'public' => $this->l10n->t('The list of blocked server domain patterns will be made publically available on the <a href="/friendica">/friendica</a> page so that your users and people investigating communication problems can find the reason easily.'),
-                               'syntax' => $this->l10n->t('<p>The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:</p>
-<ul>
-       <li><code>*</code>: Any number of characters</li>
-       <li><code>?</code>: Any single character</li>
-</ul>'),
-                               'importtitle'    => $this->l10n->t('Import server domain pattern blocklist'),
-                               'addtitle'       => $this->l10n->t('Add new entry to the blocklist'),
-                               'importsubmit'   => $this->l10n->t('Upload file'),
-                               'addsubmit'      => $this->l10n->t('Check pattern'),
-                               'savechanges'    => $this->l10n->t('Save changes to the blocklist'),
-                               'currenttitle'   => $this->l10n->t('Current Entries in the Blocklist'),
-                               'thurl'          => $this->l10n->t('Blocked server domain pattern'),
-                               'threason'       => $this->l10n->t('Reason for the block'),
-                               'delentry'       => $this->l10n->t('Delete entry from the blocklist'),
-                               'confirm_delete' => $this->l10n->t('Delete entry from the blocklist?'),
-                       ],
-                       '$listfile'            => ['listfile', $this->l10n->t('Server domain pattern blocklist CSV file'), '', '', $this->l10n->t('Required'), '', 'file'],
-                       '$newdomain'           => ['pattern', $this->l10n->t('Server Domain Pattern'), '', $this->l10n->t('The domain pattern of the new server to add to the blocklist. Do not include the protocol.'), $this->l10n->t('Required'), '', ''],
-                       '$entries'             => $blocklistform,
-                       '$baseurl'             => $this->baseUrl->get(true),
-                       '$form_security_token' => self::getFormSecurityToken('admin_blocklist'),
-                       '$form_security_token_import' => self::getFormSecurityToken('admin_blocklist_import'),
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Item/Delete.php b/src/Module/Admin/Item/Delete.php
deleted file mode 100644 (file)
index d291e7b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Item;
-
-use Friendica\Core\Renderer;
-use Friendica\DI;
-use Friendica\Model\Item;
-use Friendica\Module\BaseAdmin;
-
-class Delete extends BaseAdmin
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               if (empty($_POST['page_deleteitem_submit'])) {
-                       return;
-               }
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/item/delete', 'admin_deleteitem');
-
-               if (!empty($_POST['page_deleteitem_submit'])) {
-                       $guid = trim($_POST['deleteitemguid']);
-                       // The GUID should not include a "/", so if there is one, we got an URL
-                       // and the last part of it is most likely the GUID.
-                       if (strpos($guid, '/')) {
-                               $guid = substr($guid, strrpos($guid, '/') + 1);
-                       }
-                       // Now that we have the GUID, drop those items, which will also delete the
-                       // associated threads.
-                       Item::markForDeletion(['guid' => $guid]);
-               }
-
-               DI::sysmsg()->addInfo(DI::l10n()->t('Item marked for deletion.'));
-               DI::baseUrl()->redirect('admin/item/delete');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $t = Renderer::getMarkupTemplate('admin/item/delete.tpl');
-
-               return Renderer::replaceMacros($t, [
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('Delete Item'),
-                       '$submit' => DI::l10n()->t('Delete this Item'),
-                       '$intro1' => DI::l10n()->t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
-                       '$intro2' => DI::l10n()->t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
-                       '$deleteitemguid' => ['deleteitemguid', DI::l10n()->t("GUID"), '', DI::l10n()->t("The GUID of the item you want to delete."), DI::l10n()->t('Required'), 'autofocus'],
-                       '$form_security_token' => self::getFormSecurityToken("admin_deleteitem")
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Item/Source.php b/src/Module/Admin/Item/Source.php
deleted file mode 100644 (file)
index fe3f367..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Item;
-
-use Friendica\Core\Renderer;
-use Friendica\DI;
-use Friendica\Model;
-use Friendica\Module\BaseAdmin;
-
-class Source extends BaseAdmin
-
-{
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $guid = basename($_REQUEST['guid'] ?? $this->parameters['guid'] ?? '');
-
-               $item_uri = '';
-               $item_id = '';
-               $terms = [];
-               if (!empty($guid)) {
-                       $item = Model\Post::selectFirst(['id', 'uri-id', 'guid', 'uri'], ['guid' => $guid]);
-
-                       if ($item) {
-                               $item_id = $item['id'];
-                               $item_uri = $item['uri'];
-                               $terms = Model\Tag::getByURIId($item['uri-id'], [Model\Tag::HASHTAG, Model\Tag::MENTION, Model\Tag::IMPLICIT_MENTION]);
-                       }
-               }
-
-               $tpl = Renderer::getMarkupTemplate('admin/item/source.tpl');
-               $o = Renderer::replaceMacros($tpl, [
-                       '$title'       => DI::l10n()->t('Item Source'),
-                       '$guid'        => ['guid', DI::l10n()->t('Item Guid'), $guid, ''],
-                       '$item_uri'    => $item_uri,
-                       '$item_id'     => $item_id,
-                       '$terms'       => $terms,
-                       '$itemidlbl'   => DI::l10n()->t('Item Id'),
-                       '$itemurilbl'  => DI::l10n()->t('Item URI'),
-                       '$submit'      => DI::l10n()->t('Submit'),
-                       '$termslbl'    => DI::l10n()->t('Terms'),
-                       '$taglbl'      => DI::l10n()->t('Tag'),
-                       '$typelbl'     => DI::l10n()->t('Type'),
-                       '$termlbl'     => DI::l10n()->t('Term'),
-                       '$urllbl'      => DI::l10n()->t('URL'),
-                       '$mentionlbl'  => DI::l10n()->t('Mention'),
-                       '$implicitlbl' => DI::l10n()->t('Implicit Mention'),
-               ]);
-
-               return $o;
-       }
-}
index 7d159a483c47853fc962c76d461d6514b460a8f9..46d1ee9ad1a3f5387a7d85d6fe8a1ba35c941a64 100644 (file)
@@ -187,27 +187,6 @@ class Summary extends BaseAdmin
                        }
                }
 
-               $accounts = [
-                       [DI::l10n()->t('Normal Account'), 0],
-                       [DI::l10n()->t('Automatic Follower Account'), 0],
-                       [DI::l10n()->t('Public Forum Account'), 0],
-                       [DI::l10n()->t('Automatic Friend Account'), 0],
-                       [DI::l10n()->t('Blog Account'), 0],
-                       [DI::l10n()->t('Private Forum Account'), 0]
-               ];
-
-               $users = 0;
-               $pageFlagsCountStmt = DBA::p('SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `page-flags`', 0);
-               while ($pageFlagsCount = DBA::fetch($pageFlagsCountStmt)) {
-                       $accounts[$pageFlagsCount['page-flags']][1] = $pageFlagsCount['count'];
-                       $users += $pageFlagsCount['count'];
-               }
-               DBA::close($pageFlagsCountStmt);
-
-               Logger::debug('accounts', ['accounts' => $accounts]);
-
-               $pending = Register::getPendingCount();
-
                $deferred = DBA::count('workerqueue', ['NOT `done` AND `retrial` > ?', 0]);
 
                $workerqueue = DBA::count('workerqueue', ['NOT `done` AND `retrial` = ?', 0]);
@@ -235,9 +214,6 @@ class Summary extends BaseAdmin
                        '$title'          => DI::l10n()->t('Administration'),
                        '$page'           => DI::l10n()->t('Summary'),
                        '$queues'         => $queues,
-                       '$users'          => [DI::l10n()->t('Registered users'), $users],
-                       '$accounts'       => $accounts,
-                       '$pending'        => [DI::l10n()->t('Pending registrations'), $pending],
                        '$version'        => [DI::l10n()->t('Version'), App::VERSION],
                        '$platform'       => App::PLATFORM,
                        '$codename'       => App::CODENAME,
diff --git a/src/Module/Admin/Users/Active.php b/src/Module/Admin/Users/Active.php
deleted file mode 100644 (file)
index 4e021e2..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Users;
-
-use Friendica\Content\Pager;
-use Friendica\Core\Renderer;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\User;
-use Friendica\Module\Admin\BaseUsers;
-
-class Active extends BaseUsers
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError(DI::baseUrl()->get(true), 'admin_users_active');
-
-               $users = $_POST['user'] ?? [];
-
-               if (!empty($_POST['page_users_block'])) {
-                       foreach ($users as $uid) {
-                               User::block($uid);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
-               }
-
-               if (!empty($_POST['page_users_delete'])) {
-                       foreach ($users as $uid) {
-                               if (DI::userSession()->getLocalUserId() != $uid) {
-                                       User::remove($uid);
-                               } else {
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
-                               }
-                       }
-
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
-               }
-
-               DI::baseUrl()->redirect(DI::args()->getQueryString());
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $action = $this->parameters['action'] ?? '';
-               $uid = $this->parameters['uid'] ?? 0;
-
-               if ($uid) {
-                       $user = User::getById($uid, ['username', 'blocked']);
-                       if (!DBA::isResult($user)) {
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
-                               DI::baseUrl()->redirect('admin/users');
-                               return ''; // NOTREACHED
-                       }
-               }
-
-               switch ($action) {
-                       case 'delete':
-                               if (DI::userSession()->getLocalUserId() != $uid) {
-                                       self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't');
-                                       // delete user
-                                       User::remove($uid);
-
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username']));
-                               } else {
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
-                               }
-
-                               DI::baseUrl()->redirect('admin/users/active');
-                               break;
-                       case 'block':
-                               self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't');
-                               User::block($uid);
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" blocked', $user['username']));
-                               DI::baseUrl()->redirect('admin/users/active');
-                               break;
-               }
-               $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
-
-               $valid_orders = [
-                       'name',
-                       'email',
-                       'register_date',
-                       'login_date',
-                       'last-item',
-                       'page-flags'
-               ];
-
-               $order = 'name';
-               $order_direction = '+';
-               if (!empty($_GET['o'])) {
-                       $new_order = $_GET['o'];
-                       if ($new_order[0] === '-') {
-                               $order_direction = '-';
-                               $new_order = substr($new_order, 1);
-                       }
-
-                       if (in_array($new_order, $valid_orders)) {
-                               $order = $new_order;
-                       }
-               }
-
-               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'active', $order, ($order_direction == '-'));
-
-               $users = array_map(self::setupUserCallback(), $users);
-
-               $th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
-
-               $count = DBA::count('user', ["NOT `blocked` AND `verified` AND NOT `account_removed` AND `uid` != ?", 0]);
-
-               $t = Renderer::getMarkupTemplate('admin/users/active.tpl');
-               return self::getTabsHTML('active') .    Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('Active Accounts'),
-                       '$select_all' => DI::l10n()->t('select all'),
-                       '$delete' => DI::l10n()->t('Delete'),
-                       '$block' => DI::l10n()->t('Block'),
-                       '$blocked' => DI::l10n()->t('User blocked'),
-                       '$siteadmin' => DI::l10n()->t('Site admin'),
-                       '$accountexpired' => DI::l10n()->t('Account expired'),
-                       '$h_newuser' => DI::l10n()->t('Create a new user'),
-
-                       '$th_users' => $th_users,
-                       '$order_users' => $order,
-                       '$order_direction_users' => $order_direction,
-
-                       '$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
-                       '$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_users_active'),
-
-                       // values //
-                       '$baseurl' => DI::baseUrl()->get(true),
-                       '$query_string' => DI::args()->getQueryString(),
-
-                       '$users' => $users,
-                       '$count' => $count,
-                       '$pager' => $pager->renderFull($count),
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Users/Blocked.php b/src/Module/Admin/Users/Blocked.php
deleted file mode 100644 (file)
index cedbccb..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Users;
-
-use Friendica\Content\Pager;
-use Friendica\Core\Renderer;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\User;
-use Friendica\Module\Admin\BaseUsers;
-use Friendica\Util\Temporal;
-
-class Blocked extends BaseUsers
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked');
-
-               $users = $_POST['user'] ?? [];
-
-               if (!empty($_POST['page_users_unblock'])) {
-                       foreach ($users as $uid) {
-                               User::block($uid, false);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
-               }
-
-               if (!empty($_POST['page_users_delete'])) {
-                       foreach ($users as $uid) {
-                               if (DI::userSession()->getLocalUserId() != $uid) {
-                                       User::remove($uid);
-                               } else {
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
-                               }
-                       }
-
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
-               }
-
-               DI::baseUrl()->redirect('admin/users/blocked');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $action = $this->parameters['action'] ?? '';
-               $uid = $this->parameters['uid'] ?? 0;
-
-               if ($uid) {
-                       $user = User::getById($uid, ['username', 'blocked']);
-                       if (!DBA::isResult($user)) {
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
-                               DI::baseUrl()->redirect('admin/users');
-                               return ''; // NOTREACHED
-                       }
-               }
-
-               switch ($action) {
-                       case 'delete':
-                               if (DI::userSession()->getLocalUserId() != $uid) {
-                                       self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
-                                       // delete user
-                                       User::remove($uid);
-
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username']));
-                               } else {
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
-                               }
-                               DI::baseUrl()->redirect('admin/users/blocked');
-                               break;
-                       case 'unblock':
-                               self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
-                               User::block($uid, false);
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" unblocked', $user['username']));
-                               DI::baseUrl()->redirect('admin/users/blocked');
-                               break;
-               }
-
-               $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
-
-               $valid_orders = [
-                       'name',
-                       'email',
-                       'register_date',
-                       'login_date',
-                       'last-item',
-                       'page-flags'
-               ];
-
-               $order = 'name';
-               $order_direction = '+';
-               if (!empty($_GET['o'])) {
-                       $new_order = $_GET['o'];
-                       if ($new_order[0] === '-') {
-                               $order_direction = '-';
-                               $new_order = substr($new_order, 1);
-                       }
-
-                       if (in_array($new_order, $valid_orders)) {
-                               $order = $new_order;
-                       }
-               }
-
-               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'blocked', $order, ($order_direction == '-'));
-
-               $users = array_map(self::setupUserCallback(), $users);
-
-               $th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
-
-               $count = DBA::count('user', ['blocked' => true, 'verified' => true]);
-
-               $t = Renderer::getMarkupTemplate('admin/users/blocked.tpl');
-               return self::getTabsHTML('blocked') . Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('Blocked Users'),
-                       '$select_all' => DI::l10n()->t('select all'),
-                       '$delete' => DI::l10n()->t('Delete'),
-                       '$blocked' => DI::l10n()->t('User blocked'),
-                       '$unblock' => DI::l10n()->t('Unblock'),
-                       '$siteadmin' => DI::l10n()->t('Site admin'),
-                       '$accountexpired' => DI::l10n()->t('Account expired'),
-
-                       '$th_users' => $th_users,
-                       '$order_users' => $order,
-                       '$order_direction_users' => $order_direction,
-
-                       '$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
-                       '$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_users_blocked'),
-
-                       // values //
-                       '$baseurl' => DI::baseUrl()->get(true),
-                       '$query_string' => DI::args()->getQueryString(),
-
-                       '$users' => $users,
-                       '$count' => $count,
-                       '$pager' => $pager->renderFull($count)
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Users/Create.php b/src/Module/Admin/Users/Create.php
deleted file mode 100644 (file)
index 29dbf5d..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Users;
-
-use Friendica\Core\Renderer;
-use Friendica\DI;
-use Friendica\Model\User;
-use Friendica\Module\Admin\BaseUsers;
-
-class Create extends BaseUsers
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/users/create', 'admin_users_create');
-
-               $nu_name     = $_POST['new_user_name']     ?? '';
-               $nu_nickname = $_POST['new_user_nickname'] ?? '';
-               $nu_email    = $_POST['new_user_email']    ?? '';
-               $nu_language = DI::config()->get('system', 'language');
-
-               if ($nu_name !== '' && $nu_email !== '' && $nu_nickname !== '') {
-                       try {
-                               User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language);
-                               DI::baseUrl()->redirect('admin/users');
-                       } catch (\Exception $ex) {
-                               DI::sysmsg()->addNotice($ex->getMessage());
-                       }
-               }
-
-               DI::baseUrl()->redirect('admin/users/create');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $t = Renderer::getMarkupTemplate('admin/users/create.tpl');
-               return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('New User'),
-                       '$submit' => DI::l10n()->t('Add User'),
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_users_create'),
-
-                       // values //
-                       '$baseurl' => DI::baseUrl()->get(true),
-                       '$query_string' => DI::args()->getQueryString(),
-
-                       '$newusername' => ['new_user_name', DI::l10n()->t('Name'), '', DI::l10n()->t('Name of the new user.')],
-                       '$newusernickname' => ['new_user_nickname', DI::l10n()->t('Nickname'), '', DI::l10n()->t('Nickname of the new user.')],
-                       '$newuseremail' => ['new_user_email', DI::l10n()->t('Email'), '', DI::l10n()->t('Email address of the new user.'), '', '', 'email'],
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Users/Deleted.php b/src/Module/Admin/Users/Deleted.php
deleted file mode 100644 (file)
index d60ecbe..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Users;
-
-use Friendica\Content\Pager;
-use Friendica\Core\Renderer;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\Register;
-use Friendica\Model\User;
-use Friendica\Module\Admin\BaseUsers;
-use Friendica\Module\BaseAdmin;
-use Friendica\Util\Temporal;
-
-class Deleted extends BaseUsers
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/users/deleted', 'admin_users_deleted');
-
-               // @TODO: Implement user deletion cancellation
-
-               DI::baseUrl()->redirect('admin/users/deleted');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
-
-               $valid_orders = [
-                       'name',
-                       'email',
-                       'register_date',
-                       'login_date',
-                       'last-item',
-                       'page-flags'
-               ];
-
-               $order = 'name';
-               $order_direction = '+';
-               if (!empty($_GET['o'])) {
-                       $new_order = $_GET['o'];
-                       if ($new_order[0] === '-') {
-                               $order_direction = '-';
-                               $new_order = substr($new_order, 1);
-                       }
-
-                       if (in_array($new_order, $valid_orders)) {
-                               $order = $new_order;
-                       }
-               }
-
-               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'removed', $order, ($order_direction == '-'));
-
-               $users = array_map(self::setupUserCallback(), $users);
-
-               $count = DBA::count('user', ['account_removed' => true]);
-
-               $t = Renderer::getMarkupTemplate('admin/users/deleted.tpl');
-               return self::getTabsHTML('deleted') . Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('Users awaiting permanent deletion'),
-
-                       '$th_deleted' => [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Permanent deletion')],
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_users_deleted'),
-
-                       // values //
-                       '$baseurl' => DI::baseUrl()->get(true),
-                       '$query_string' => DI::args()->getQueryString(),
-
-                       '$users' => $users,
-                       '$count' => $count,
-                       '$pager' => $pager->renderFull($count),
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Users/Index.php b/src/Module/Admin/Users/Index.php
deleted file mode 100644 (file)
index b0757da..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Users;
-
-use Friendica\Content\Pager;
-use Friendica\Core\Renderer;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\User;
-use Friendica\Module\Admin\BaseUsers;
-
-class Index extends BaseUsers
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users');
-
-               $users = $_POST['user'] ?? [];
-
-               if (!empty($_POST['page_users_block'])) {
-                       foreach ($users as $uid) {
-                               User::block($uid);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
-               }
-
-               if (!empty($_POST['page_users_unblock'])) {
-                       foreach ($users as $uid) {
-                               User::block($uid, false);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
-               }
-
-               if (!empty($_POST['page_users_delete'])) {
-                       foreach ($users as $uid) {
-                               if (DI::userSession()->getLocalUserId() != $uid) {
-                                       User::remove($uid);
-                               } else {
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
-                               }
-                       }
-
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
-               }
-
-               DI::baseUrl()->redirect(DI::args()->getQueryString());
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $action = $this->parameters['action'] ?? '';
-               $uid = $this->parameters['uid'] ?? 0;
-
-               if ($uid) {
-                       $user = User::getById($uid, ['username', 'blocked']);
-                       if (!DBA::isResult($user)) {
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
-                               DI::baseUrl()->redirect('admin/users');
-                               return ''; // NOTREACHED
-                       }
-               }
-
-               switch ($action) {
-                       case 'delete':
-                               if (DI::userSession()->getLocalUserId() != $uid) {
-                                       self::checkFormSecurityTokenRedirectOnError(DI::baseUrl()->get(true), 'admin_users', 't');
-                                       // delete user
-                                       User::remove($uid);
-
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" deleted', $user['username']));
-                               } else {
-                                       DI::sysmsg()->addNotice(DI::l10n()->t('You can\'t remove yourself'));
-                               }
-
-                               DI::baseUrl()->redirect('admin/users');
-                               break;
-                       case 'block':
-                               self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't');
-                               User::block($uid);
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" blocked', $user['username']));
-                               DI::baseUrl()->redirect('admin/users');
-                               break;
-                       case 'unblock':
-                               self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't');
-                               User::block($uid, false);
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User "%s" unblocked', $user['username']));
-                               DI::baseUrl()->redirect('admin/users');
-                               break;
-               }
-               $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
-
-               $valid_orders = [
-                       'name',
-                       'email',
-                       'register_date',
-                       'login_date',
-                       'last-item',
-                       'page-flags'
-               ];
-
-               $order = 'name';
-               $order_direction = '+';
-               if (!empty($_GET['o'])) {
-                       $new_order = $_GET['o'];
-                       if ($new_order[0] === '-') {
-                               $order_direction = '-';
-                               $new_order = substr($new_order, 1);
-                       }
-
-                       if (in_array($new_order, $valid_orders)) {
-                               $order = $new_order;
-                       }
-               }
-
-               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'all', $order, ($order_direction == '-'));
-
-               $users = array_map(self::setupUserCallback(), $users);
-
-               $th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
-
-               $count = DBA::count('user', ["`uid` != ?", 0]);
-
-               $t = Renderer::getMarkupTemplate('admin/users/index.tpl');
-               return self::getTabsHTML('all') .       Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('Users'),
-                       '$select_all' => DI::l10n()->t('select all'),
-                       '$h_deleted' => DI::l10n()->t('User waiting for permanent deletion'),
-                       '$delete' => DI::l10n()->t('Delete'),
-                       '$block' => DI::l10n()->t('Block'),
-                       '$blocked' => DI::l10n()->t('User blocked'),
-                       '$unblock' => DI::l10n()->t('Unblock'),
-                       '$siteadmin' => DI::l10n()->t('Site admin'),
-                       '$accountexpired' => DI::l10n()->t('Account expired'),
-
-                       '$h_users' => DI::l10n()->t('Users'),
-                       '$h_newuser' => DI::l10n()->t('Create a new user'),
-                       '$th_deleted' => [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Permanent deletion')],
-                       '$th_users' => $th_users,
-                       '$order_users' => $order,
-                       '$order_direction_users' => $order_direction,
-
-                       '$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
-                       '$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_users'),
-
-                       // values //
-                       '$baseurl' => DI::baseUrl()->get(true),
-                       '$query_string' => DI::args()->getQueryString(),
-
-                       '$users' => $users,
-                       '$count' => $count,
-                       '$pager' => $pager->renderFull($count),
-               ]);
-       }
-}
diff --git a/src/Module/Admin/Users/Pending.php b/src/Module/Admin/Users/Pending.php
deleted file mode 100644 (file)
index 484a128..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>.
- *
- */
-
-namespace Friendica\Module\Admin\Users;
-
-use Friendica\Content\Pager;
-use Friendica\Core\Renderer;
-use Friendica\Database\DBA;
-use Friendica\DI;
-use Friendica\Model\Register;
-use Friendica\Model\User;
-use Friendica\Module\Admin\BaseUsers;
-use Friendica\Module\BaseAdmin;
-use Friendica\Util\Temporal;
-
-class Pending extends BaseUsers
-{
-       protected function post(array $request = [])
-       {
-               self::checkAdminAccess();
-
-               self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending');
-
-               $pending = $_POST['pending'] ?? [];
-
-               if (!empty($_POST['page_users_approve'])) {
-                       foreach ($pending as $hash) {
-                               User::allow($hash);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
-               }
-
-               if (!empty($_POST['page_users_deny'])) {
-                       foreach ($pending as $hash) {
-                               User::deny($hash);
-                       }
-                       DI::sysmsg()->addInfo(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
-               }
-
-               DI::baseUrl()->redirect('admin/users/pending');
-       }
-
-       protected function content(array $request = []): string
-       {
-               parent::content();
-
-               $action = $this->parameters['action'] ?? '';
-               $uid = $this->parameters['uid'] ?? 0;
-
-               if ($uid) {
-                       $user = User::getById($uid, ['username', 'blocked']);
-                       if (!DBA::isResult($user)) {
-                               DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
-                               DI::baseUrl()->redirect('admin/users');
-                               return ''; // NOTREACHED
-                       }
-               }
-
-               switch ($action) {
-                       case 'allow':
-                               self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
-                               User::allow(Register::getPendingForUser($uid)['hash'] ?? '');
-                               DI::sysmsg()->addNotice(DI::l10n()->t('Account approved.'));
-                               DI::baseUrl()->redirect('admin/users/pending');
-                               break;
-                       case 'deny':
-                               self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
-                               User::deny(Register::getPendingForUser($uid)['hash'] ?? '');
-                               DI::sysmsg()->addNotice(DI::l10n()->t('Registration revoked'));
-                               DI::baseUrl()->redirect('admin/users/pending');
-                               break;
-               }
-
-               $pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
-
-               $pending = Register::getPending($pager->getStart(), $pager->getItemsPerPage());
-
-               $count = Register::getPendingCount();
-
-               $t = Renderer::getMarkupTemplate('admin/users/pending.tpl');
-               return self::getTabsHTML('pending') . Renderer::replaceMacros($t, [
-                       // strings //
-                       '$title' => DI::l10n()->t('Administration'),
-                       '$page' => DI::l10n()->t('User registrations awaiting review'),
-                       '$select_all' => DI::l10n()->t('select all'),
-                       '$th_pending' => [DI::l10n()->t('Request date'), DI::l10n()->t('Name'), DI::l10n()->t('Email')],
-                       '$no_pending' => DI::l10n()->t('No registrations.'),
-                       '$pendingnotetext' => DI::l10n()->t('Note from the user'),
-                       '$approve' => DI::l10n()->t('Approve'),
-                       '$deny' => DI::l10n()->t('Deny'),
-
-                       '$form_security_token' => self::getFormSecurityToken('admin_users_pending'),
-
-                       // values //
-                       '$baseurl' => DI::baseUrl()->get(true),
-                       '$query_string' => DI::args()->getQueryString(),
-
-                       '$pending' => $pending,
-                       '$count' => $count,
-                       '$pager' => $pager->renderFull($count),
-               ]);
-       }
-}
index 1c9fc0f2446ab41759eaa85cfe58ab567a7c3206..6181202a3e64be86848df1c3023b169be18253c6 100644 (file)
@@ -89,7 +89,6 @@ abstract class BaseAdmin extends BaseModule
                        'configuration' => [DI::l10n()->t('Configuration'), [
                                'site'         => ['admin/site'        , DI::l10n()->t('Site')                    , 'site'],
                                'storage'      => ['admin/storage'     , DI::l10n()->t('Storage')                 , 'storage'],
-                               'users'        => ['admin/users'       , DI::l10n()->t('Users')                   , 'users'],
                                'addons'       => ['admin/addons'      , DI::l10n()->t('Addons')                  , 'addons'],
                                'themes'       => ['admin/themes'      , DI::l10n()->t('Themes')                  , 'themes'],
                                'features'     => ['admin/features'    , DI::l10n()->t('Additional features')     , 'features'],
@@ -100,11 +99,6 @@ abstract class BaseAdmin extends BaseModule
                                'deferred'     => ['admin/queue/deferred', DI::l10n()->t('Inspect Deferred Workers'), 'deferred'],
                                'workerqueue'  => ['admin/queue'       , DI::l10n()->t('Inspect worker Queue')    , 'workerqueue'],
                        ]],
-                       'tools' => [DI::l10n()->t('Tools'), [
-                               'contactblock' => ['admin/blocklist/contact', DI::l10n()->t('Contact Blocklist')  , 'contactblock'],
-                               'blocklist'    => ['admin/blocklist/server' , DI::l10n()->t('Server Blocklist')   , 'blocklist'],
-                               'deleteitem'   => ['admin/item/delete' , DI::l10n()->t('Delete Item')             , 'deleteitem'],
-                       ]],
                        'logs' => [DI::l10n()->t('Logs'), [
                                'logsconfig'   => ['admin/logs/', DI::l10n()->t('Logs')                           , 'logs'],
                                'logsview'     => ['admin/logs/view'    , DI::l10n()->t('View Logs')              , 'viewlogs'],
@@ -113,7 +107,6 @@ abstract class BaseAdmin extends BaseModule
                                'phpinfo'      => ['admin/phpinfo'           , DI::l10n()->t('PHP Info')          , 'phpinfo'],
                                'probe'        => ['probe'             , DI::l10n()->t('probe address')           , 'probe'],
                                'webfinger'    => ['webfinger'         , DI::l10n()->t('check webfinger')         , 'webfinger'],
-                               'itemsource'   => ['admin/item/source' , DI::l10n()->t('Item Source')             , 'itemsource'],
                                'babel'        => ['babel'             , DI::l10n()->t('Babel')                   , 'babel'],
                                'debug/ap'     => ['debug/ap'          , DI::l10n()->t('ActivityPub Conversion')  , 'debug/ap'],
                        ]],
diff --git a/src/Module/BaseModeration.php b/src/Module/BaseModeration.php
new file mode 100644 (file)
index 0000000..1261eeb
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module;
+
+use Friendica\App;
+use Friendica\BaseModule;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
+
+/**
+ * This abstract module is meant to be extended by all modules that are reserved to moderator users.
+ *
+ * It performs a blanket permission check in all the module methods as long as the relevant `parent::method()` is
+ * called in the inheriting module.
+ *
+ * Additionally, it puts together the moderation page aside with all the moderation links.
+ *
+ * @package Friendica\Module
+ */
+abstract class BaseModeration extends BaseModule
+{
+       /** @var IHandleUserSessions */
+       protected $session;
+       /** @var SystemMessages */
+       protected $systemMessages;
+       /** @var App */
+       protected $app;
+       /** @var App\Page */
+       protected $page;
+
+       public function __construct(App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->session        = $session;
+               $this->systemMessages = $systemMessages;
+               $this->app            = $app;
+               $this->page           = $page;
+       }
+
+       /**
+        * Checks moderator access and throws exceptions if not logged-in moderator
+        *
+        * @param bool $interactive
+        * @return void
+        * @throws HTTPException\ForbiddenException
+        * @throws HTTPException\InternalServerErrorException
+        */
+       public function checkModerationAccess(bool $interactive = false)
+       {
+               if (!$this->session->getLocalUserId()) {
+                       if ($interactive) {
+                               $this->systemMessages->addNotice($this->t('Please login to continue.'));
+                               $this->session->set('return_path', $this->args->getQueryString());
+                               $this->baseUrl->redirect('login');
+                       } else {
+                               throw new HTTPException\UnauthorizedException($this->t('Please login to continue.'));
+                       }
+               }
+
+               if (!$this->app->isSiteAdmin()) {
+                       throw new HTTPException\ForbiddenException($this->t('You don\'t have access to administration pages.'));
+               }
+
+               if ($this->session->getSubManagedUserId()) {
+                       throw new HTTPException\ForbiddenException($this->t('Submanaged account can\'t access the administration pages. Please log back in as the main account.'));
+               }
+       }
+
+       protected function content(array $request = []): string
+       {
+               $this->checkModerationAccess(true);
+
+               // Header stuff
+               $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('moderation/settings_head.tpl'), []);
+
+               /*
+                * Side bar links
+                */
+
+               // array(url, name, extra css classes)
+               // not part of $aside to make the template more adjustable
+               $aside_sub = [
+                       'information' => [$this->t('Information'), [
+                               'overview' => ['moderation', $this->t('Overview'), 'overview'],
+                       ]],
+                       'configuration' => [$this->t('Configuration'), [
+                               'users' => ['moderation/users', $this->t('Users'), 'users'],
+                       ]],
+                       'tools' => [$this->t('Tools'), [
+                               'contactblock' => ['moderation/blocklist/contact', $this->t('Contact Blocklist'), 'contactblock'],
+                               'blocklist'    => ['moderation/blocklist/server', $this->t('Server Blocklist'), 'blocklist'],
+                               'deleteitem'   => ['moderation/item/delete', $this->t('Delete Item'), 'deleteitem'],
+                       ]],
+                       'diagnostics' => [$this->t('Diagnostics'), [
+                               'itemsource' => ['moderation/item/source', $this->t('Item Source'), 'itemsource'],
+                       ]],
+               ];
+
+               $t = Renderer::getMarkupTemplate('moderation/aside.tpl');
+               $this->page['aside'] .= Renderer::replaceMacros($t, [
+                       '$subpages'  => $aside_sub,
+                       '$admtxt'    => $this->t('Moderation'),
+                       '$h_pending' => $this->t('User registrations waiting for confirmation'),
+                       '$modurl'    => 'moderation/'
+               ]);
+
+               return '';
+       }
+}
diff --git a/src/Module/Moderation/BaseUsers.php b/src/Module/Moderation/BaseUsers.php
new file mode 100644 (file)
index 0000000..eddfc09
--- /dev/null
@@ -0,0 +1,149 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation;
+
+use Friendica\App;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Database\Database;
+use Friendica\DI;
+use Friendica\Model\Register;
+use Friendica\Model\User;
+use Friendica\Module\BaseModeration;
+use Friendica\Module\Response;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Network\HTTPException\ServiceUnavailableException;
+use Friendica\Util\Profiler;
+use Friendica\Util\Temporal;
+use Psr\Log\LoggerInterface;
+
+abstract class BaseUsers extends BaseModeration
+{
+       /** @var Database */
+       protected $database;
+
+       public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->database = $database;
+       }
+
+       /**
+        * Get the users moderation tabs menu
+        *
+        * @param string $selectedTab
+        * @return string HTML
+        * @throws ServiceUnavailableException
+        */
+       protected function getTabsHTML(string $selectedTab): string
+       {
+               $all     = $this->database->count('user', ["`uid` != ?", 0]);
+               $active  = $this->database->count('user', ["NOT `blocked` AND `verified` AND NOT `account_removed` AND `uid` != ?", 0]);
+               $pending = Register::getPendingCount();
+               $blocked = $this->database->count('user', ['blocked' => true, 'verified' => true, 'account_removed' => false]);
+               $deleted = $this->database->count('user', ['account_removed' => true]);
+
+               $tabs = [
+                       [
+                               'label'     => $this->t('All') . ' (' . $all . ')',
+                               'url'       => 'moderation/users',
+                               'sel'       => !$selectedTab || $selectedTab == 'all' ? 'active' : '',
+                               'title'     => $this->t('List of all users'),
+                               'id'        => 'admin-users-all',
+                               'accesskey' => 'a',
+                       ],
+                       [
+                               'label'     => $this->t('Active') . ' (' . $active . ')',
+                               'url'       => 'moderation/users/active',
+                               'sel'       => $selectedTab == 'active' ? 'active' : '',
+                               'title'     => $this->t('List of active accounts'),
+                               'id'        => 'admin-users-active',
+                               'accesskey' => 'k',
+                       ],
+                       [
+                               'label'     => $this->t('Pending') . ($pending ? ' (' . $pending . ')' : ''),
+                               'url'       => 'moderation/users/pending',
+                               'sel'       => $selectedTab == 'pending' ? 'active' : '',
+                               'title'     => $this->t('List of pending registrations'),
+                               'id'        => 'admin-users-pending',
+                               'accesskey' => 'p',
+                       ],
+                       [
+                               'label'     => $this->t('Blocked') . ($blocked ? ' (' . $blocked . ')' : ''),
+                               'url'       => 'moderation/users/blocked',
+                               'sel'       => $selectedTab == 'blocked' ? 'active' : '',
+                               'title'     => $this->t('List of blocked users'),
+                               'id'        => 'admin-users-blocked',
+                               'accesskey' => 'b',
+                       ],
+                       [
+                               'label'     => $this->t('Deleted') . ($deleted ? ' (' . $deleted . ')' : ''),
+                               'url'       => 'moderation/users/deleted',
+                               'sel'       => $selectedTab == 'deleted' ? 'active' : '',
+                               'title'     => $this->t('List of pending user deletions'),
+                               'id'        => 'admin-users-deleted',
+                               'accesskey' => 'd',
+                       ],
+               ];
+
+               $tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
+               return Renderer::replaceMacros($tpl, ['$tabs' => $tabs]);
+       }
+
+       protected function setupUserCallback(): \Closure
+       {
+               $adminlist = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
+               return function ($user) use ($adminlist) {
+                       $page_types = [
+                               User::PAGE_FLAGS_NORMAL    => $this->t('Normal Account Page'),
+                               User::PAGE_FLAGS_SOAPBOX   => $this->t('Soapbox Page'),
+                               User::PAGE_FLAGS_COMMUNITY => $this->t('Public Forum'),
+                               User::PAGE_FLAGS_FREELOVE  => $this->t('Automatic Friend Page'),
+                               User::PAGE_FLAGS_PRVGROUP  => $this->t('Private Forum')
+                       ];
+                       $account_types = [
+                               User::ACCOUNT_TYPE_PERSON       => $this->t('Personal Page'),
+                               User::ACCOUNT_TYPE_ORGANISATION => $this->t('Organisation Page'),
+                               User::ACCOUNT_TYPE_NEWS         => $this->t('News Page'),
+                               User::ACCOUNT_TYPE_COMMUNITY    => $this->t('Community Forum'),
+                               User::ACCOUNT_TYPE_RELAY        => $this->t('Relay'),
+                       ];
+
+                       $user['page_flags_raw'] = $user['page-flags'];
+                       $user['page_flags']     = $page_types[$user['page-flags']];
+
+                       $user['account_type_raw'] = ($user['page_flags_raw'] == 0) ? $user['account-type'] : -1;
+                       $user['account_type']     = ($user['page_flags_raw'] == 0) ? $account_types[$user['account-type']] : '';
+
+                       $user['register_date'] = Temporal::getRelativeDate($user['register_date']);
+                       $user['login_date']    = Temporal::getRelativeDate($user['login_date']);
+                       $user['lastitem_date'] = Temporal::getRelativeDate($user['last-item']);
+                       $user['is_admin']      = in_array($user['email'], $adminlist);
+                       $user['is_deletable']  = !$user['account_removed'] && intval($user['uid']) != $this->session->getLocalUserId();
+                       $user['deleted']       = $user['account_removed'] ? Temporal::getRelativeDate($user['account_expires_on']) : false;
+
+                       return $user;
+               };
+       }
+}
diff --git a/src/Module/Moderation/Blocklist/Contact.php b/src/Module/Moderation/Blocklist/Contact.php
new file mode 100644 (file)
index 0000000..f3583bc
--- /dev/null
@@ -0,0 +1,138 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Blocklist;
+
+use Friendica\App;
+use Friendica\Content\Pager;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Core\Worker;
+use Friendica\Database\Database;
+use Friendica\Model;
+use Friendica\Module\BaseModeration;
+use Friendica\Module\Response;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Util\Network;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
+
+class Contact extends BaseModeration
+{
+       /** @var Database */
+       private $database;
+
+       public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->database = $database;
+       }
+
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/blocklist/contact', 'moderation_contactblock');
+
+               $contact_url  = $request['contact_url']          ?? '';
+               $block_reason = $request['contact_block_reason'] ?? '';
+               $block_purge  = $request['contact_block_purge']  ?? false;
+               $contacts     = $request['contacts']             ?? [];
+
+               if (!empty($request['page_contactblock_block'])) {
+                       $contact = Model\Contact::getByURL($contact_url, null, ['id', 'nurl']);
+                       if (empty($contact)) {
+                               $this->systemMessages->addNotice($this->t('Could not find any contact entry for this URL (%s)', $contact_url));
+                               $this->baseUrl->redirect('moderation/blocklist/contact');
+                       }
+
+                       if (Network::isLocalLink($contact['nurl'])) {
+                               $this->systemMessages->addNotice($this->t('You can\'t block a local contact, please block the user instead'));
+                               $this->baseUrl->redirect('moderation/blocklist/contact');
+                       }
+
+                       Model\Contact::block($contact['id'], $block_reason);
+
+                       if ($block_purge) {
+                               foreach (Model\Contact::selectToArray(['id'], ['nurl' => $contact['nurl']]) as $contact) {
+                                       Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
+                               }
+                       }
+
+                       $this->systemMessages->addInfo($this->t('The contact has been blocked from the node'));
+               }
+
+               if (!empty($request['page_contactblock_unblock'])) {
+                       foreach ($contacts as $uid) {
+                               Model\Contact::unblock($uid);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s contact unblocked', '%s contacts unblocked', count($contacts)));
+               }
+
+               $this->baseUrl->redirect('moderation/blocklist/contact');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $condition = ['uid' => 0, 'blocked' => true];
+
+               $total = $this->database->count('contact', $condition);
+
+               $pager = new Pager($this->l10n, $this->args->getQueryString(), 30);
+
+               $contacts = Model\Contact::selectToArray([], $condition, ['limit' => [$pager->getStart(), $pager->getItemsPerPage()]]);
+
+               $t = Renderer::getMarkupTemplate('moderation/blocklist/contact.tpl');
+               return Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title'       => $this->t('Moderation'),
+                       '$page'        => $this->t('Remote Contact Blocklist'),
+                       '$description' => $this->t('This page allows you to prevent any message from a remote contact to reach your node.'),
+                       '$submit'      => $this->t('Block Remote Contact'),
+                       '$select_all'  => $this->t('select all'),
+                       '$select_none' => $this->t('select none'),
+                       '$block'       => $this->t('Block'),
+                       '$unblock'     => $this->t('Unblock'),
+                       '$no_data'     => $this->t('No remote contact is blocked from this node.'),
+
+                       '$h_contacts'  => $this->t('Blocked Remote Contacts'),
+                       '$h_newblock'  => $this->t('Block New Remote Contact'),
+                       '$th_contacts' => [$this->t('Photo'), $this->t('Name'), $this->t('Reason')],
+
+                       '$form_security_token' => self::getFormSecurityToken('moderation_contactblock'),
+
+                       // values //
+                       '$baseurl' => $this->baseUrl->get(true),
+
+                       '$contacts'       => $contacts,
+                       '$total_contacts' => $this->tt('%s total blocked contact', '%s total blocked contacts', $total),
+                       '$paginate'       => $pager->renderFull($total),
+
+                       '$contacturl'           => ['contact_url', $this->t('Profile URL'), '', $this->t('URL of the remote contact to block.')],
+                       '$contact_block_purge'  => ['contact_block_purge', $this->t('Also purge contact'), false, $this->t('Removes all content related to this contact from the node. Keeps the contact record. This action cannot be undone.')],
+                       '$contact_block_reason' => ['contact_block_reason', $this->t('Block Reason')],
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Blocklist/Server/Add.php b/src/Module/Moderation/Blocklist/Server/Add.php
new file mode 100644 (file)
index 0000000..54cae5c
--- /dev/null
@@ -0,0 +1,143 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Blocklist\Server;
+
+use Friendica\App;
+use Friendica\Content\ContactSelector;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Core\Worker;
+use Friendica\Model\Contact;
+use Friendica\Model\GServer;
+use Friendica\Moderation\DomainPatternBlocklist;
+use Friendica\Module\BaseModeration;
+use Friendica\Module\Response;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
+use GuzzleHttp\Psr7\Uri;
+use Psr\Log\LoggerInterface;
+
+class Add extends BaseModeration
+{
+       /** @var DomainPatternBlocklist */
+       private $blocklist;
+
+       public function __construct(DomainPatternBlocklist $blocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->blocklist = $blocklist;
+       }
+
+       /**
+        * @param array $request
+        * @return void
+        * @throws HTTPException\ForbiddenException
+        * @throws HTTPException\FoundException
+        * @throws HTTPException\InternalServerErrorException
+        * @throws HTTPException\MovedPermanentlyException
+        * @throws HTTPException\TemporaryRedirectException
+        * @throws \Exception
+        */
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               if (empty($request['page_blocklist_add'])) {
+                       return;
+               }
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/blocklist/server/add', 'moderation_blocklist_add');
+
+               $pattern = trim($request['pattern']);
+
+               //  Add new item to blocklist
+               $this->blocklist->addPattern($pattern, trim($request['reason']));
+
+               $this->systemMessages->addInfo($this->t('Server domain pattern added to the blocklist.'));
+
+               if (!empty($request['purge'])) {
+                       $gservers = GServer::listByDomainPattern($pattern);
+                       foreach (Contact::selectToArray(['id'], ['gsid' => array_column($gservers, 'id')]) as $contact) {
+                               Worker::add(Worker::PRIORITY_LOW, 'Contact\RemoveContent', $contact['id']);
+                       }
+
+                       $this->systemMessages->addInfo($this->tt('%s server scheduled to be purged.', '%s servers scheduled to be purged.', count($gservers)));
+               }
+
+               $this->baseUrl->redirect('moderation/blocklist/server');
+       }
+
+       /**
+        * @param array $request
+        * @return string
+        * @throws HTTPException\InternalServerErrorException
+        * @throws HTTPException\ServiceUnavailableException
+        * @throws \Exception
+        */
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $gservers = [];
+
+               if ($pattern = trim($request['pattern'] ?? '')) {
+                       $gservers = GServer::listByDomainPattern($pattern);
+               }
+
+               array_walk($gservers, function (array &$gserver) {
+                       $gserver['domain'] = (new Uri($gserver['url']))->getHost();
+                       $gserver['network_icon'] = ContactSelector::networkToIcon($gserver['network']);
+                       $gserver['network_name'] = ContactSelector::networkToName($gserver['network']);
+               });
+
+               $t = Renderer::getMarkupTemplate('moderation/blocklist/server/add.tpl');
+               return Renderer::replaceMacros($t, [
+                       '$l10n' => [
+                               'return_list' => $this->t('← Return to the list'),
+                               'title'       => $this->t('Moderation'),
+                               'page'        => $this->t('Block A New Server Domain Pattern'),
+                               'syntax'      => $this->t('<p>The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:</p>
+<ul>
+       <li><code>*</code>: Any number of characters</li>
+       <li><code>?</code>: Any single character</li>
+</ul>'),
+                               'submit'           => $this->t('Check pattern'),
+                               'matching_servers' => $this->t('Matching known servers'),
+                               'server_name'      => $this->t('Server Name'),
+                               'server_domain'    => $this->t('Server Domain'),
+                               'known_contacts'   => $this->t('Known Contacts'),
+                               'server_count'     => $this->tt('%d known server', '%d known servers', count($gservers)),
+                               'add_pattern'      => $this->t('Add pattern to the blocklist'),
+                       ],
+                       '$newdomain'           => ['pattern', $this->t('Server Domain Pattern'), $pattern, $this->t('The domain pattern of the new server to add to the blocklist. Do not include the protocol.'), $this->t('Required'), '', ''],
+                       '$newpurge'            => ['purge', $this->t('Purge server'), $request['purge'] ?? false, $this->tt('Also purges all the locally stored content authored by the known contacts registered on that server. Keeps the contacts and the server records. This action cannot be undone.', 'Also purges all the locally stored content authored by the known contacts registered on these servers. Keeps the contacts and the servers records. This action cannot be undone.', count($gservers))],
+                       '$newreason'           => ['reason', $this->t('Block reason'), $request['reason'] ?? '', $this->t('The reason why you blocked this server domain pattern. This reason will be shown publicly in the server information page.'), $this->t('Required'), '', ''],
+                       '$pattern'             => $pattern,
+                       '$gservers'            => $gservers,
+                       '$baseurl'             => $this->baseUrl->get(true),
+                       '$form_security_token' => self::getFormSecurityToken('moderation_blocklist_add')
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Blocklist/Server/Import.php b/src/Module/Moderation/Blocklist/Server/Import.php
new file mode 100644 (file)
index 0000000..98e35f7
--- /dev/null
@@ -0,0 +1,134 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Blocklist\Server;
+
+use Friendica\App;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Moderation\DomainPatternBlocklist;
+use Friendica\Module\Response;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Network\HTTPException;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
+
+class Import extends \Friendica\Module\BaseModeration
+{
+       /** @var DomainPatternBlocklist */
+       private $localBlocklist;
+
+       /** @var array of blocked server domain patterns */
+       private $blocklist = [];
+
+       public function __construct(DomainPatternBlocklist $localBlocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->localBlocklist = $localBlocklist;
+       }
+
+       /**
+        * @param array $request
+        * @return void
+        * @throws HTTPException\ForbiddenException
+        * @throws HTTPException\FoundException
+        * @throws HTTPException\InternalServerErrorException
+        * @throws HTTPException\MovedPermanentlyException
+        * @throws HTTPException\TemporaryRedirectException
+        */
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               if (!isset($request['page_blocklist_upload']) && !isset($request['page_blocklist_import'])) {
+                       return;
+               }
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/blocklist/server/import', 'moderation_blocklist_import');
+
+               if (isset($request['page_blocklist_upload'])) {
+                       try {
+                               $this->blocklist = $this->localBlocklist::extractFromCSVFile($_FILES['listfile']['tmp_name']);
+                       } catch (\Throwable $e) {
+                               $this->systemMessages->addNotice($this->t('Error importing pattern file'));
+                       }
+
+                       return;
+               }
+
+               if (isset($request['page_blocklist_import'])) {
+                       $blocklist = json_decode($request['blocklist'], true);
+                       if ($blocklist === null) {
+                               $this->systemMessages->addNotice($this->t('Error importing pattern file'));
+                               return;
+                       }
+
+                       if (($request['mode'] ?? 'append') == 'replace') {
+                               $this->localBlocklist->set($blocklist);
+                               $this->systemMessages->addNotice($this->t('Local blocklist replaced with the provided file.'));
+                       } else {
+                               $count = $this->localBlocklist->append($blocklist);
+                               if ($count) {
+                                       $this->systemMessages->addNotice($this->tt('%d pattern was added to the local blocklist.', '%d patterns were added to the local blocklist.', $count));
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('No pattern was added to the local blocklist.'));
+                               }
+                       }
+
+                       $this->baseUrl->redirect('/moderation/blocklist/server');
+               }
+       }
+
+       /**
+        * @param array $request
+        * @return string
+        * @throws HTTPException\ServiceUnavailableException
+        */
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $t = Renderer::getMarkupTemplate('moderation/blocklist/server/import.tpl');
+               return Renderer::replaceMacros($t, [
+                       '$l10n' => [
+                               'return_list'    => $this->t('← Return to the list'),
+                               'title'          => $this->t('Moderation'),
+                               'page'           => $this->t('Import a Server Domain Pattern Blocklist'),
+                               'download'       => $this->t('<p>This file can be downloaded from the <code>/friendica</code> path of any Friendica server.</p>'),
+                               'upload'         => $this->t('Upload file'),
+                               'patterns'       => $this->t('Patterns to import'),
+                               'domain_pattern' => $this->t('Domain Pattern'),
+                               'block_reason'   => $this->t('Block Reason'),
+                               'mode'           => $this->t('Import Mode'),
+                               'import'         => $this->t('Import Patterns'),
+                               'pattern_count'  => $this->tt('%d total pattern', '%d total patterns', count($this->blocklist)),
+                       ],
+                       '$listfile'            => ['listfile', $this->t('Server domain pattern blocklist CSV file'), '', '', $this->t('Required'), '', 'file'],
+                       '$mode_append'         => ['mode', $this->t('Append'), 'append', $this->t('Imports patterns from the file that weren\'t already existing in the current blocklist.'), 'checked="checked"'],
+                       '$mode_replace'        => ['mode', $this->t('Replace'), 'replace', $this->t('Replaces the current blocklist by the imported patterns.')],
+                       '$blocklist'           => $this->blocklist,
+                       '$baseurl'             => $this->baseUrl->get(true),
+                       '$form_security_token' => self::getFormSecurityToken('moderation_blocklist_import')
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Blocklist/Server/Index.php b/src/Module/Moderation/Blocklist/Server/Index.php
new file mode 100644 (file)
index 0000000..e75d50d
--- /dev/null
@@ -0,0 +1,121 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Blocklist\Server;
+
+use Friendica\App;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Moderation\DomainPatternBlocklist;
+use Friendica\Module\BaseModeration;
+use Friendica\Module\Response;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
+
+class Index extends BaseModeration
+{
+       /** @var DomainPatternBlocklist */
+       private $blocklist;
+
+       public function __construct(DomainPatternBlocklist $blocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->blocklist = $blocklist;
+       }
+
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               if (empty($request['page_blocklist_edit'])) {
+                       return;
+               }
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/blocklist/server', 'moderation_blocklist');
+
+               // Edit the entries from blocklist
+               $blocklist = [];
+               foreach ($request['domain'] as $id => $domain) {
+                       // Trimming whitespaces as well as any lingering slashes
+                       $domain = trim($domain);
+                       $reason = trim($request['reason'][$id]);
+                       if (empty($request['delete'][$id])) {
+                               $blocklist[] = [
+                                       'domain' => $domain,
+                                       'reason' => $reason
+                               ];
+                       }
+               }
+
+               $this->blocklist->set($blocklist);
+
+               $this->baseUrl->redirect('moderation/blocklist/server');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $blocklistform = [];
+               foreach ($this->blocklist->get() as $id => $b) {
+                       $blocklistform[] = [
+                               'domain' => ["domain[$id]", $this->t('Blocked server domain pattern'), $b['domain'], '', $this->t('Required'), '', ''],
+                               'reason' => ["reason[$id]", $this->t("Reason for the block"), $b['reason'], '', $this->t('Required'), '', ''],
+                               'delete' => ["delete[$id]", $this->t("Delete server domain pattern") . ' (' . $b['domain'] . ')', false, $this->t("Check to delete this entry from the blocklist")]
+                       ];
+               }
+
+               $t = Renderer::getMarkupTemplate('moderation/blocklist/server/index.tpl');
+               return Renderer::replaceMacros($t, [
+                       '$l10n' => [
+                               'title'  => $this->t('Moderation'),
+                               'page'   => $this->t('Server Domain Pattern Blocklist'),
+                               'intro'  => $this->t('This page can be used to define a blocklist of server domain patterns from the federated network that are not allowed to interact with your node. For each domain pattern you should also provide the reason why you block it.'),
+                               'public' => $this->t('The list of blocked server domain patterns will be made publically available on the <a href="/friendica">/friendica</a> page so that your users and people investigating communication problems can find the reason easily.'),
+                               'syntax' => $this->t('<p>The server domain pattern syntax is case-insensitive shell wildcard, comprising the following special characters:</p>
+<ul>
+       <li><code>*</code>: Any number of characters</li>
+       <li><code>?</code>: Any single character</li>
+</ul>'),
+                               'importtitle'    => $this->t('Import server domain pattern blocklist'),
+                               'addtitle'       => $this->t('Add new entry to the blocklist'),
+                               'importsubmit'   => $this->t('Upload file'),
+                               'addsubmit'      => $this->t('Check pattern'),
+                               'savechanges'    => $this->t('Save changes to the blocklist'),
+                               'currenttitle'   => $this->t('Current Entries in the Blocklist'),
+                               'thurl'          => $this->t('Blocked server domain pattern'),
+                               'threason'       => $this->t('Reason for the block'),
+                               'delentry'       => $this->t('Delete entry from the blocklist'),
+                               'confirm_delete' => $this->t('Delete entry from the blocklist?'),
+                       ],
+                       '$listfile'  => ['listfile', $this->t('Server domain pattern blocklist CSV file'), '', '', $this->t('Required'), '', 'file'],
+                       '$newdomain' => ['pattern', $this->t('Server Domain Pattern'), '', $this->t('The domain pattern of the new server to add to the blocklist. Do not include the protocol.'), $this->t('Required'), '', ''],
+                       '$entries'   => $blocklistform,
+                       '$baseurl'   => $this->baseUrl->get(true),
+
+                       '$form_security_token'        => self::getFormSecurityToken('moderation_blocklist'),
+                       '$form_security_token_import' => self::getFormSecurityToken('moderation_blocklist_import'),
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Item/Delete.php b/src/Module/Moderation/Item/Delete.php
new file mode 100644 (file)
index 0000000..6367988
--- /dev/null
@@ -0,0 +1,71 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Item;
+
+use Friendica\Core\Renderer;
+use Friendica\Model\Item;
+use Friendica\Module\BaseModeration;
+
+class Delete extends BaseModeration
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               if (empty($request['page_deleteitem_submit'])) {
+                       return;
+               }
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/item/delete', 'moderation_deleteitem');
+
+               $guid = trim($request['deleteitemguid']);
+               // The GUID should not include a "/", so if there is one, we got an URL
+               // and the last part of it is most likely the GUID.
+               if (strpos($guid, '/')) {
+                       $guid = substr($guid, strrpos($guid, '/') + 1);
+               }
+               // Now that we have the GUID, drop those items, which will also delete the
+               // associated threads.
+               Item::markForDeletion(['guid' => $guid]);
+
+               $this->systemMessages->addInfo($this->t('Item marked for deletion.'));
+               $this->baseUrl->redirect('moderation/item/delete');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $t = Renderer::getMarkupTemplate('moderation/item/delete.tpl');
+
+               return Renderer::replaceMacros($t, [
+                       '$title'  => $this->t('Moderation'),
+                       '$page'   => $this->t('Delete Item'),
+                       '$submit' => $this->t('Delete this Item'),
+                       '$intro1' => $this->t('On this page you can delete an item from your node. If the item is a top level posting, the entire thread will be deleted.'),
+                       '$intro2' => $this->t('You need to know the GUID of the item. You can find it e.g. by looking at the display URL. The last part of http://example.com/display/123456 is the GUID, here 123456.'),
+
+                       '$deleteitemguid'      => ['deleteitemguid', $this->t("GUID"), '', $this->t("The GUID of the item you want to delete."), $this->t('Required'), 'autofocus'],
+                       '$form_security_token' => self::getFormSecurityToken("moderation_deleteitem")
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Item/Source.php b/src/Module/Moderation/Item/Source.php
new file mode 100644 (file)
index 0000000..3830488
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Item;
+
+use Friendica\Core\Renderer;
+use Friendica\Model;
+use Friendica\Module\BaseModeration;
+
+class Source extends BaseModeration
+{
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $guid = basename($request['guid'] ?? $this->parameters['guid'] ?? '');
+
+               $item_uri = '';
+               $item_id = '';
+               $terms = [];
+               if (!empty($guid)) {
+                       $item = Model\Post::selectFirst(['id', 'uri-id', 'guid', 'uri'], ['guid' => $guid]);
+
+                       if ($item) {
+                               $item_id = $item['id'];
+                               $item_uri = $item['uri'];
+                               $terms = Model\Tag::getByURIId($item['uri-id'], [Model\Tag::HASHTAG, Model\Tag::MENTION, Model\Tag::IMPLICIT_MENTION]);
+                       }
+               }
+
+               $tpl = Renderer::getMarkupTemplate('moderation/item/source.tpl');
+               return Renderer::replaceMacros($tpl, [
+                       '$title'       => $this->t('Item Source'),
+                       '$guid'        => ['guid', $this->t('Item Guid'), $guid, ''],
+                       '$item_uri'    => $item_uri,
+                       '$item_id'     => $item_id,
+                       '$terms'       => $terms,
+                       '$itemidlbl'   => $this->t('Item Id'),
+                       '$itemurilbl'  => $this->t('Item URI'),
+                       '$submit'      => $this->t('Submit'),
+                       '$termslbl'    => $this->t('Terms'),
+                       '$taglbl'      => $this->t('Tag'),
+                       '$typelbl'     => $this->t('Type'),
+                       '$termlbl'     => $this->t('Term'),
+                       '$urllbl'      => $this->t('URL'),
+                       '$mentionlbl'  => $this->t('Mention'),
+                       '$implicitlbl' => $this->t('Implicit Mention'),
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Summary.php b/src/Module/Moderation/Summary.php
new file mode 100644 (file)
index 0000000..c8719c1
--- /dev/null
@@ -0,0 +1,84 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation;
+
+use Friendica\App;
+use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
+use Friendica\Core\Session\Capability\IHandleUserSessions;
+use Friendica\Database\Database;
+use Friendica\Model\Register;
+use Friendica\Module\BaseModeration;
+use Friendica\Module\Response;
+use Friendica\Navigation\SystemMessages;
+use Friendica\Util\Profiler;
+use Psr\Log\LoggerInterface;
+
+class Summary extends BaseModeration
+{
+       /** @var Database */
+       private $database;
+
+       public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
+       {
+               parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
+
+               $this->database = $database;
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $accounts = [
+                       [$this->t('Normal Account'), 0],
+                       [$this->t('Automatic Follower Account'), 0],
+                       [$this->t('Public Forum Account'), 0],
+                       [$this->t('Automatic Friend Account'), 0],
+                       [$this->t('Blog Account'), 0],
+                       [$this->t('Private Forum Account'), 0]
+               ];
+
+               $users = 0;
+
+               $pageFlagsCountStmt = $this->database->p('SELECT `page-flags`, COUNT(`uid`) AS `count` FROM `user` WHERE `uid` != ? GROUP BY `page-flags`', 0);
+               while ($pageFlagsCount = $this->database->fetch($pageFlagsCountStmt)) {
+                       $accounts[$pageFlagsCount['page-flags']][1] = $pageFlagsCount['count'];
+                       $users += $pageFlagsCount['count'];
+               }
+               $this->database->close($pageFlagsCountStmt);
+
+               $this->logger->debug('accounts', ['accounts' => $accounts]);
+
+               $pending = Register::getPendingCount();
+
+               $t = Renderer::getMarkupTemplate('moderation/summary.tpl');
+               return Renderer::replaceMacros($t, [
+                       '$title'       => $this->t('Moderation'),
+                       '$page'        => $this->t('Summary'),
+                       '$users'       => [$this->t('Registered users'), $users],
+                       '$accounts'    => $accounts,
+                       '$pending'     => [$this->t('Pending registrations'), $pending],
+                       '$warningtext' => [],
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Users/Active.php b/src/Module/Moderation/Users/Active.php
new file mode 100644 (file)
index 0000000..922351d
--- /dev/null
@@ -0,0 +1,161 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Users;
+
+use Friendica\Content\Pager;
+use Friendica\Core\Renderer;
+use Friendica\Model\User;
+use Friendica\Module\Moderation\BaseUsers;
+
+class Active extends BaseUsers
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError($this->baseUrl->get(true), 'moderation_users_active');
+
+               $users = $request['user'] ?? [];
+
+               if (!empty($request['page_users_block'])) {
+                       foreach ($users as $uid) {
+                               User::block($uid);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s user blocked', '%s users blocked', count($users)));
+               }
+
+               if (!empty($request['page_users_delete'])) {
+                       foreach ($users as $uid) {
+                               if ($this->session->getLocalUserId() != $uid) {
+                                       User::remove($uid);
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('You can\'t remove yourself'));
+                               }
+                       }
+
+                       $this->systemMessages->addInfo($this->tt('%s user deleted', '%s users deleted', count($users)));
+               }
+
+               $this->baseUrl->redirect($this->args->getQueryString());
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $action = $this->parameters['action'] ?? '';
+               $uid    = $this->parameters['uid']    ?? 0;
+
+               if ($uid) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('moderation/users');
+                       }
+               }
+
+               switch ($action) {
+                       case 'delete':
+                               if ($this->session->getLocalUserId() != $uid) {
+                                       self::checkFormSecurityTokenRedirectOnError('moderation/users/active', 'moderation_users_active', 't');
+                                       // delete user
+                                       User::remove($uid);
+
+                                       $this->systemMessages->addNotice($this->t('User "%s" deleted', $user['username']));
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('You can\'t remove yourself'));
+                               }
+
+                               $this->baseUrl->redirect('moderation/users/active');
+                               break;
+                       case 'block':
+                               self::checkFormSecurityTokenRedirectOnError('moderation/users/active', 'moderation_users_active', 't');
+                               User::block($uid);
+                               $this->systemMessages->addNotice($this->t('User "%s" blocked', $user['username']));
+                               $this->baseUrl->redirect('moderation/users/active');
+                               break;
+               }
+               $pager = new Pager($this->l10n, $this->args->getQueryString(), 100);
+
+               $valid_orders = [
+                       'name',
+                       'email',
+                       'register_date',
+                       'login_date',
+                       'last-item',
+                       'page-flags',
+               ];
+
+               $order           = 'name';
+               $order_direction = '+';
+               if (!empty($request['o'])) {
+                       $new_order = $request['o'];
+                       if ($new_order[0] === '-') {
+                               $order_direction = '-';
+                               $new_order       = substr($new_order, 1);
+                       }
+
+                       if (in_array($new_order, $valid_orders)) {
+                               $order = $new_order;
+                       }
+               }
+
+               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'active', $order, ($order_direction == '-'));
+
+               $users = array_map($this->setupUserCallback(), $users);
+
+               $th_users = array_map(null, [$this->t('Name'), $this->t('Email'), $this->t('Register date'), $this->t('Last login'), $this->t('Last public item'), $this->t('Type')], $valid_orders);
+
+               $count = $this->database->count('user', ["NOT `blocked` AND `verified` AND NOT `account_removed` AND `uid` != ?", 0]);
+
+               $t = Renderer::getMarkupTemplate('moderation/users/active.tpl');
+               return self::getTabsHTML('active') . Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title'          => $this->t('Moderation'),
+                       '$page'           => $this->t('Active Accounts'),
+                       '$select_all'     => $this->t('select all'),
+                       '$delete'         => $this->t('Delete'),
+                       '$block'          => $this->t('Block'),
+                       '$blocked'        => $this->t('User blocked'),
+                       '$siteadmin'      => $this->t('Site admin'),
+                       '$accountexpired' => $this->t('Account expired'),
+                       '$h_newuser'      => $this->t('Create a new user'),
+
+                       '$th_users'              => $th_users,
+                       '$order_users'           => $order,
+                       '$order_direction_users' => $order_direction,
+
+                       '$confirm_delete_multi' => $this->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
+                       '$confirm_delete'       => $this->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
+
+                       '$form_security_token' => self::getFormSecurityToken('moderation_users_active'),
+
+                       // values //
+                       '$baseurl'      => $this->baseUrl->get(true),
+                       '$query_string' => $this->args->getQueryString(),
+
+                       '$users' => $users,
+                       '$count' => $count,
+                       '$pager' => $pager->renderFull($count),
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Users/Blocked.php b/src/Module/Moderation/Users/Blocked.php
new file mode 100644 (file)
index 0000000..0222629
--- /dev/null
@@ -0,0 +1,160 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Users;
+
+use Friendica\Content\Pager;
+use Friendica\Core\Renderer;
+use Friendica\Model\User;
+use Friendica\Module\Moderation\BaseUsers;
+
+class Blocked extends BaseUsers
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/users/blocked', 'moderation_users_blocked');
+
+               $users = $request['user'] ?? [];
+
+               if (!empty($request['page_users_unblock'])) {
+                       foreach ($users as $uid) {
+                               User::block($uid, false);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s user unblocked', '%s users unblocked', count($users)));
+               }
+
+               if (!empty($request['page_users_delete'])) {
+                       foreach ($users as $uid) {
+                               if ($this->session->getLocalUserId() != $uid) {
+                                       User::remove($uid);
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('You can\'t remove yourself'));
+                               }
+                       }
+
+                       $this->systemMessages->addInfo($this->tt('%s user deleted', '%s users deleted', count($users)));
+               }
+
+               $this->baseUrl->redirect('moderation/users/blocked');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $action = $this->parameters['action'] ?? '';
+               $uid    = $this->parameters['uid']    ?? 0;
+
+               if ($uid) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('moderation/users');
+                       }
+               }
+
+               switch ($action) {
+                       case 'delete':
+                               if ($this->session->getLocalUserId() != $uid) {
+                                       self::checkFormSecurityTokenRedirectOnError('/moderation/users/blocked', 'moderation_users_blocked', 't');
+                                       // delete user
+                                       User::remove($uid);
+
+                                       $this->systemMessages->addNotice($this->t('User "%s" deleted', $user['username']));
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('You can\'t remove yourself'));
+                               }
+                               $this->baseUrl->redirect('moderation/users/blocked');
+                               break;
+                       case 'unblock':
+                               self::checkFormSecurityTokenRedirectOnError('/moderation/users/blocked', 'moderation_users_blocked', 't');
+                               User::block($uid, false);
+                               $this->systemMessages->addNotice($this->t('User "%s" unblocked', $user['username']));
+                               $this->baseUrl->redirect('moderation/users/blocked');
+                               break;
+               }
+
+               $pager = new Pager($this->l10n, $this->args->getQueryString(), 100);
+
+               $valid_orders = [
+                       'name',
+                       'email',
+                       'register_date',
+                       'login_date',
+                       'last-item',
+                       'page-flags',
+               ];
+
+               $order           = 'name';
+               $order_direction = '+';
+               if (!empty($request['o'])) {
+                       $new_order = $request['o'];
+                       if ($new_order[0] === '-') {
+                               $order_direction = '-';
+                               $new_order       = substr($new_order, 1);
+                       }
+
+                       if (in_array($new_order, $valid_orders)) {
+                               $order = $new_order;
+                       }
+               }
+
+               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'blocked', $order, ($order_direction == '-'));
+
+               $users = array_map($this->setupUserCallback(), $users);
+
+               $th_users = array_map(null, [$this->t('Name'), $this->t('Email'), $this->t('Register date'), $this->t('Last login'), $this->t('Last public item'), $this->t('Type')], $valid_orders);
+
+               $count = $this->database->count('user', ['blocked' => true, 'verified' => true]);
+
+               $t = Renderer::getMarkupTemplate('moderation/users/blocked.tpl');
+               return self::getTabsHTML('blocked') . Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title'          => $this->t('Moderation'),
+                       '$page'           => $this->t('Blocked Users'),
+                       '$select_all'     => $this->t('select all'),
+                       '$delete'         => $this->t('Delete'),
+                       '$blocked'        => $this->t('User blocked'),
+                       '$unblock'        => $this->t('Unblock'),
+                       '$siteadmin'      => $this->t('Site admin'),
+                       '$accountexpired' => $this->t('Account expired'),
+
+                       '$th_users'              => $th_users,
+                       '$order_users'           => $order,
+                       '$order_direction_users' => $order_direction,
+
+                       '$confirm_delete_multi' => $this->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
+                       '$confirm_delete'       => $this->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
+
+                       '$form_security_token' => self::getFormSecurityToken('moderation_users_blocked'),
+
+                       // values //
+                       '$baseurl'      => $this->baseUrl->get(true),
+                       '$query_string' => $this->args->getQueryString(),
+
+                       '$users' => $users,
+                       '$count' => $count,
+                       '$pager' => $pager->renderFull($count)
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Users/Create.php b/src/Module/Moderation/Users/Create.php
new file mode 100644 (file)
index 0000000..a017cf6
--- /dev/null
@@ -0,0 +1,76 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Users;
+
+use Friendica\Core\Renderer;
+use Friendica\DI;
+use Friendica\Model\User;
+use Friendica\Module\Moderation\BaseUsers;
+
+class Create extends BaseUsers
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('/admin/users/create', 'admin_users_create');
+
+               $nu_name     = $request['new_user_name'] ?? '';
+               $nu_nickname = $request['new_user_nickname'] ?? '';
+               $nu_email    = $request['new_user_email'] ?? '';
+               $nu_language = DI::config()->get('system', 'language');
+
+               if ($nu_name !== '' && $nu_email !== '' && $nu_nickname !== '') {
+                       try {
+                               User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language);
+                               $this->baseUrl->redirect('admin/users');
+                       } catch (\Exception $ex) {
+                               $this->systemMessages->addNotice($ex->getMessage());
+                       }
+               }
+
+               $this->baseUrl->redirect('admin/users/create');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $t = Renderer::getMarkupTemplate('admin/users/create.tpl');
+               return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title'  => $this->t('Administration'),
+                       '$page'   => $this->t('New User'),
+                       '$submit' => $this->t('Add User'),
+
+                       '$form_security_token' => self::getFormSecurityToken('admin_users_create'),
+
+                       // values //
+                       '$baseurl'      => $this->baseUrl->get(true),
+                       '$query_string' => $this->args->getQueryString(),
+
+                       '$newusername'     => ['new_user_name', $this->t('Name'), '', $this->t('Name of the new user.')],
+                       '$newusernickname' => ['new_user_nickname', $this->t('Nickname'), '', $this->t('Nickname of the new user.')],
+                       '$newuseremail'    => ['new_user_email', $this->t('Email'), '', $this->t('Email address of the new user.'), '', '', 'email'],
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Users/Deleted.php b/src/Module/Moderation/Users/Deleted.php
new file mode 100644 (file)
index 0000000..2dd6d6a
--- /dev/null
@@ -0,0 +1,96 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Users;
+
+use Friendica\Content\Pager;
+use Friendica\Core\Renderer;
+use Friendica\Model\User;
+use Friendica\Module\Moderation\BaseUsers;
+
+class Deleted extends BaseUsers
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('/moderation/users/deleted', 'moderation_users_deleted');
+
+               // @TODO: Implement user deletion cancellation
+
+               $this->baseUrl->redirect('moderation/users/deleted');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $pager = new Pager($this->l10n, $this->args->getQueryString(), 100);
+
+               $valid_orders = [
+                       'name',
+                       'email',
+                       'register_date',
+                       'login_date',
+                       'last-item',
+                       'page-flags',
+               ];
+
+               $order = 'name';
+               $order_direction = '+';
+               if (!empty($request['o'])) {
+                       $new_order = $request['o'];
+                       if ($new_order[0] === '-') {
+                               $order_direction = '-';
+                               $new_order = substr($new_order, 1);
+                       }
+
+                       if (in_array($new_order, $valid_orders)) {
+                               $order = $new_order;
+                       }
+               }
+
+               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'removed', $order, ($order_direction == '-'));
+
+               $users = array_map($this->setupUserCallback(), $users);
+
+               $count = $this->database->count('user', ['account_removed' => true]);
+
+               $t = Renderer::getMarkupTemplate('moderation/users/deleted.tpl');
+               return self::getTabsHTML('deleted') . Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title' => $this->t('Moderation'),
+                       '$page'  => $this->t('Users awaiting permanent deletion'),
+
+                       '$th_deleted' => [$this->t('Name'), $this->t('Email'), $this->t('Register date'), $this->t('Last login'), $this->t('Last public item'), $this->t('Permanent deletion')],
+
+                       '$form_security_token' => self::getFormSecurityToken('moderation_users_deleted'),
+
+                       // values //
+                       '$baseurl'      => $this->baseUrl->get(true),
+                       '$query_string' => $this->args->getQueryString(),
+
+                       '$users' => $users,
+                       '$count' => $count,
+                       '$pager' => $pager->renderFull($count),
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Users/Index.php b/src/Module/Moderation/Users/Index.php
new file mode 100644 (file)
index 0000000..0652865
--- /dev/null
@@ -0,0 +1,179 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Users;
+
+use Friendica\Content\Pager;
+use Friendica\Core\Renderer;
+use Friendica\Model\User;
+use Friendica\Module\Moderation\BaseUsers;
+
+class Index extends BaseUsers
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('moderation/users', 'moderation_users');
+
+               $users = $request['user'] ?? [];
+
+               if (!empty($request['page_users_block'])) {
+                       foreach ($users as $uid) {
+                               User::block($uid);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s user blocked', '%s users blocked', count($users)));
+               }
+
+               if (!empty($request['page_users_unblock'])) {
+                       foreach ($users as $uid) {
+                               User::block($uid, false);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s user unblocked', '%s users unblocked', count($users)));
+               }
+
+               if (!empty($request['page_users_delete'])) {
+                       foreach ($users as $uid) {
+                               if ($this->session->getLocalUserId() != $uid) {
+                                       User::remove($uid);
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('You can\'t remove yourself'));
+                               }
+                       }
+
+                       $this->systemMessages->addInfo($this->tt('%s user deleted', '%s users deleted', count($users)));
+               }
+
+               $this->baseUrl->redirect($this->args->getQueryString());
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $action = $this->parameters['action'] ?? '';
+               $uid    = $this->parameters['uid']    ?? 0;
+
+               if ($uid) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('moderation/users');
+                       }
+               }
+
+               switch ($action) {
+                       case 'delete':
+                               if ($this->session->getLocalUserId() != $uid) {
+                                       self::checkFormSecurityTokenRedirectOnError($this->baseUrl->get(true), 'moderation_users', 't');
+                                       // delete user
+                                       User::remove($uid);
+
+                                       $this->systemMessages->addNotice($this->t('User "%s" deleted', $user['username']));
+                               } else {
+                                       $this->systemMessages->addNotice($this->t('You can\'t remove yourself'));
+                               }
+
+                               $this->baseUrl->redirect('moderation/users');
+                               break;
+                       case 'block':
+                               self::checkFormSecurityTokenRedirectOnError('moderation/users', 'moderation_users', 't');
+                               User::block($uid);
+                               $this->systemMessages->addNotice($this->t('User "%s" blocked', $user['username']));
+                               $this->baseUrl->redirect('moderation/users');
+                               break;
+                       case 'unblock':
+                               self::checkFormSecurityTokenRedirectOnError('moderation/users', 'moderation_users', 't');
+                               User::block($uid, false);
+                               $this->systemMessages->addNotice($this->t('User "%s" unblocked', $user['username']));
+                               $this->baseUrl->redirect('moderation/users');
+                               break;
+               }
+
+               $pager = new Pager($this->l10n, $this->args->getQueryString(), 100);
+
+               $valid_orders = [
+                       'name',
+                       'email',
+                       'register_date',
+                       'login_date',
+                       'last-item',
+                       'page-flags',
+               ];
+
+               $order           = 'name';
+               $order_direction = '+';
+               if (!empty($request['o'])) {
+                       $new_order = $request['o'];
+                       if ($new_order[0] === '-') {
+                               $order_direction = '-';
+                               $new_order       = substr($new_order, 1);
+                       }
+
+                       if (in_array($new_order, $valid_orders)) {
+                               $order = $new_order;
+                       }
+               }
+
+               $users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'all', $order, ($order_direction == '-'));
+
+               $users = array_map($this->setupUserCallback(), $users);
+
+               $th_users = array_map(null, [$this->t('Name'), $this->t('Email'), $this->t('Register date'), $this->t('Last login'), $this->t('Last public item'), $this->t('Type')], $valid_orders);
+
+               $count = $this->database->count('user', ["`uid` != ?", 0]);
+
+               $t = Renderer::getMarkupTemplate('moderation/users/index.tpl');
+               return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title'          => $this->t('Moderation'),
+                       '$page'           => $this->t('Users'),
+                       '$select_all'     => $this->t('select all'),
+                       '$h_deleted'      => $this->t('User waiting for permanent deletion'),
+                       '$delete'         => $this->t('Delete'),
+                       '$block'          => $this->t('Block'),
+                       '$blocked'        => $this->t('User blocked'),
+                       '$unblock'        => $this->t('Unblock'),
+                       '$siteadmin'      => $this->t('Site admin'),
+                       '$accountexpired' => $this->t('Account expired'),
+
+                       '$h_users'               => $this->t('Users'),
+                       '$h_newuser'             => $this->t('Create a new user'),
+                       '$th_deleted'            => [$this->t('Name'), $this->t('Email'), $this->t('Register date'), $this->t('Last login'), $this->t('Last public item'), $this->t('Permanent deletion')],
+                       '$th_users'              => $th_users,
+                       '$order_users'           => $order,
+                       '$order_direction_users' => $order_direction,
+
+                       '$confirm_delete_multi' => $this->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
+                       '$confirm_delete'       => $this->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
+
+                       '$form_security_token' => self::getFormSecurityToken('moderation_users'),
+
+                       // values //
+                       '$baseurl'      => $this->baseUrl->get(true),
+                       '$query_string' => $this->args->getQueryString(),
+
+                       '$users' => $users,
+                       '$count' => $count,
+                       '$pager' => $pager->renderFull($count),
+               ]);
+       }
+}
diff --git a/src/Module/Moderation/Users/Pending.php b/src/Module/Moderation/Users/Pending.php
new file mode 100644 (file)
index 0000000..569d040
--- /dev/null
@@ -0,0 +1,116 @@
+<?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Friendica\Module\Moderation\Users;
+
+use Friendica\Content\Pager;
+use Friendica\Core\Renderer;
+use Friendica\Model\Register;
+use Friendica\Model\User;
+use Friendica\Module\Moderation\BaseUsers;
+
+class Pending extends BaseUsers
+{
+       protected function post(array $request = [])
+       {
+               $this->checkModerationAccess();
+
+               self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending');
+
+               $pending = $request['pending'] ?? [];
+
+               if (!empty($request['page_users_approve'])) {
+                       foreach ($pending as $hash) {
+                               User::allow($hash);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s user approved', '%s users approved', count($pending)));
+               }
+
+               if (!empty($request['page_users_deny'])) {
+                       foreach ($pending as $hash) {
+                               User::deny($hash);
+                       }
+                       $this->systemMessages->addInfo($this->tt('%s registration revoked', '%s registrations revoked', count($pending)));
+               }
+
+               $this->baseUrl->redirect('admin/users/pending');
+       }
+
+       protected function content(array $request = []): string
+       {
+               parent::content();
+
+               $action = $this->parameters['action'] ?? '';
+               $uid    = $this->parameters['uid'] ?? 0;
+
+               if ($uid) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('admin/users');
+                       }
+               }
+
+               switch ($action) {
+                       case 'allow':
+                               self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
+                               User::allow(Register::getPendingForUser($uid)['hash'] ?? '');
+                               $this->systemMessages->addNotice($this->t('Account approved.'));
+                               $this->baseUrl->redirect('admin/users/pending');
+                               break;
+                       case 'deny':
+                               self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
+                               User::deny(Register::getPendingForUser($uid)['hash'] ?? '');
+                               $this->systemMessages->addNotice($this->t('Registration revoked'));
+                               $this->baseUrl->redirect('admin/users/pending');
+                               break;
+               }
+
+               $pager = new Pager($this->l10n, $this->args->getQueryString(), 100);
+
+               $pending = Register::getPending($pager->getStart(), $pager->getItemsPerPage());
+
+               $count = Register::getPendingCount();
+
+               $t = Renderer::getMarkupTemplate('admin/users/pending.tpl');
+               return self::getTabsHTML('pending') . Renderer::replaceMacros($t, [
+                       // strings //
+                       '$title' => $this->t('Administration'),
+                       '$page' => $this->t('User registrations awaiting review'),
+                       '$select_all' => $this->t('select all'),
+                       '$th_pending' => [$this->t('Request date'), $this->t('Name'), $this->t('Email')],
+                       '$no_pending' => $this->t('No registrations.'),
+                       '$pendingnotetext' => $this->t('Note from the user'),
+                       '$approve' => $this->t('Approve'),
+                       '$deny' => $this->t('Deny'),
+
+                       '$form_security_token' => self::getFormSecurityToken('admin_users_pending'),
+
+                       // values //
+                       '$baseurl' => $this->baseUrl->get(true),
+                       '$query_string' => $this->args->getQueryString(),
+
+                       '$pending' => $pending,
+                       '$count' => $count,
+                       '$pager' => $pager->renderFull($count),
+               ]);
+       }
+}
index e64b138307c1001f2022df5971758f88e80354e4..321e7659c4126b5f0635addf1baefc058fe9c47e 100644 (file)
@@ -315,20 +315,11 @@ return [
                '/addons'         => [Module\Admin\Addons\Index::class,   [R::GET, R::POST]],
                '/addons/{addon}' => [Module\Admin\Addons\Details::class, [R::GET, R::POST]],
 
-
-               '/blocklist/contact'       => [Module\Admin\Blocklist\Contact::class,       [R::GET, R::POST]],
-               '/blocklist/server'        => [Module\Admin\Blocklist\Server\Index::class,  [R::GET, R::POST]],
-               '/blocklist/server/add'    => [Module\Admin\Blocklist\Server\Add::class,    [R::GET, R::POST]],
-               '/blocklist/server/import' => [Module\Admin\Blocklist\Server\Import::class, [R::GET, R::POST]],
-
                '/dbsync[/{action}[/{update:\d+}]]' => [Module\Admin\DBSync::class, [R::GET]],
 
                '/features'   => [Module\Admin\Features::class,   [R::GET, R::POST]],
                '/federation' => [Module\Admin\Federation::class, [R::GET]],
 
-               '/item/delete'          => [Module\Admin\Item\Delete::class, [R::GET, R::POST]],
-               '/item/source[/{guid}]' => [Module\Admin\Item\Source::class, [R::GET, R::POST]],
-
                '/logs/view' => [Module\Admin\Logs\View::class,     [R::GET]],
                '/logs'      => [Module\Admin\Logs\Settings::class, [R::GET, R::POST]],
 
@@ -346,13 +337,6 @@ return [
                '/themes/{theme}/embed' => [Module\Admin\Themes\Embed::class,   [R::GET, R::POST]],
 
                '/tos' => [Module\Admin\Tos::class, [R::GET, R::POST]],
-
-               '/users[/{action}/{uid}]'         => [Module\Admin\Users\Index::class,   [R::GET, R::POST]],
-               '/users/active[/{action}/{uid}]'  => [Module\Admin\Users\Active::class,  [R::GET, R::POST]],
-               '/users/pending[/{action}/{uid}]' => [Module\Admin\Users\Pending::class, [R::GET, R::POST]],
-               '/users/blocked[/{action}/{uid}]' => [Module\Admin\Users\Blocked::class, [R::GET, R::POST]],
-               '/users/deleted'                  => [Module\Admin\Users\Deleted::class, [R::GET         ]],
-               '/users/create'                   => [Module\Admin\Users\Create::class,  [R::GET, R::POST]],
        ],
        '/amcd'                => [Module\AccountManagementControlDocument::class, [R::GET]],
        '/acctlink'            => [Module\Acctlink::class,     [R::GET]],
@@ -474,6 +458,24 @@ return [
        '/magic'              => [Module\Magic::class,           [R::GET]],
        '/manifest'           => [Module\Manifest::class,        [R::GET]],
        '/friendica.webmanifest'  => [Module\Manifest::class,    [R::GET]],
+       '/moderation'               => [
+               '[/]' => [Module\Moderation\Summary::class, [R::GET]],
+
+               '/blocklist/contact'       => [Module\Moderation\Blocklist\Contact::class,       [R::GET, R::POST]],
+               '/blocklist/server'        => [Module\Moderation\Blocklist\Server\Index::class,  [R::GET, R::POST]],
+               '/blocklist/server/add'    => [Module\Moderation\Blocklist\Server\Add::class,    [R::GET, R::POST]],
+               '/blocklist/server/import' => [Module\Moderation\Blocklist\Server\Import::class, [R::GET, R::POST]],
+
+               '/item/delete'          => [Module\Moderation\Item\Delete::class, [R::GET, R::POST]],
+               '/item/source[/{guid}]' => [Module\Moderation\Item\Source::class, [R::GET, R::POST]],
+
+               '/users[/{action}/{uid}]'         => [Module\Moderation\Users\Index::class,   [R::GET, R::POST]],
+               '/users/active[/{action}/{uid}]'  => [Module\Moderation\Users\Active::class,  [R::GET, R::POST]],
+               '/users/pending[/{action}/{uid}]' => [Module\Moderation\Users\Pending::class, [R::GET, R::POST]],
+               '/users/blocked[/{action}/{uid}]' => [Module\Moderation\Users\Blocked::class, [R::GET, R::POST]],
+               '/users/deleted'                  => [Module\Moderation\Users\Deleted::class, [R::GET         ]],
+               '/users/create'                   => [Module\Moderation\Users\Create::class,  [R::GET, R::POST]],
+       ],
        '/modexp/{nick}'      => [Module\PublicRSAKey::class,    [R::GET]],
        '/newmember'          => [Module\Welcome::class,         [R::GET]],
        '/nodeinfo/1.0'       => [Module\NodeInfo110::class,     [R::GET]],
diff --git a/view/templates/admin/blocklist/contact.tpl b/view/templates/admin/blocklist/contact.tpl
deleted file mode 100644 (file)
index f12eed7..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<script>
-       function selectall(cls) {
-               $('.' + cls).prop('checked', true);
-               return false;
-       }
-       function selectnone(cls) {
-               $('.' + cls).prop('checked', false);
-               return false;
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}}</h1>
-       <p>{{$description nofilter}}</p>
-       <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
-        <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               <h3>{{$h_contacts}}</h3>
-       {{if $contacts}}
-               <table id="contactblock">
-                       <thead>
-                               <tr>
-                                       <th></th>
-                                               {{foreach $th_contacts as $th}}
-                                       <th>
-                                               {{$th}}
-                                       </th>
-                                       {{/foreach}}
-                               </tr>
-                       </thead>
-                       <tbody>
-                               {{foreach $contacts as $contact}}
-                               <tr>
-                                       <td class="checkbox"><input type="checkbox" class="contacts_ckbx" id="id_contact_{{$contact.id}}" name="contacts[]" value="{{$contact.id}}"/></td>
-                                       <td><img class="icon" src="{{$contact.micro}}" alt="{{$contact.nickname}}" title="{{$contact.nickname}}"></td>
-                                       <td class="name">
-                                               {{$contact.name}}<br>
-                                               <a href="{{$contact.url}}" title="{{$contact.nickname}}">{{$contact.addr}}</a>
-                                       </td>
-                                       <td class="reason">{{if $contact.block_reason}}{{$contact.block_reason}}{{else}}N/A{{/if}}</td>
-                               </tr>
-                               {{/foreach}}
-                       </tbody>
-               </table>
-               <p><a href="#" onclick="return selectall('contacts_ckbx');">{{$select_all}}</a> | <a href="#" onclick="return selectnone('contacts_ckbx');">{{$select_none}}</a></p>
-               {{$paginate nofilter}}
-               <div class="submit"><input type="submit" name="page_contactblock_unblock" value="{{$unblock}}" /></div>
-       {{else}}
-               <p>{{$no_data}}</p>
-       {{/if}}
-       </form>
-
-       <h3>{{$h_newblock}}</h3>
-       <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               <table id="contactblock">
-                       <tbody>
-                               <tr>
-                                       <td>{{include file="field_input.tpl" field=$contacturl}}</td>
-                                       <td>{{include file="field_checkbox.tpl" field=$contact_block_purge}}</td>
-                                       <td>{{include file="field_textarea.tpl" field=$contact_block_reason}}</td>
-                               </tr>
-                       </tbody>
-               </table>
-               <div class="submit"><input type="submit" name="page_contactblock_block" value="{{$submit}}" /></div>
-       </form>
-</div>
-
diff --git a/view/templates/admin/blocklist/server/add.tpl b/view/templates/admin/blocklist/server/add.tpl
deleted file mode 100644 (file)
index 999965d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<div id="adminpage">
-       <p><a href="{{$baseurl}}/admin/blocklist/server">{{$l10n.return_list}}</a></p>
-       <h1>{{$l10n.title}} - {{$l10n.page}}</h1>
-       {{$l10n.syntax nofilter}}
-
-       <form action="{{$baseurl}}/admin/blocklist/server/add" method="get">
-               {{include file="field_input.tpl" field=$newdomain}}
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary">{{$l10n.submit}}</button>
-               </div>
-       </form>
-{{if $pattern}}
-       <h2>{{$l10n.matching_servers}}</h2>
-       <form action="{{$baseurl}}/admin/blocklist/server/add" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-        <input type="hidden" name="pattern" value="{{$pattern}}">
-               <table class="table table-condensed table-striped table-bordered">
-                       <thead>
-                               <tr>
-                                       <th></th>
-                                       <th>{{$l10n.server_name}}</th>
-                                       <th>{{$l10n.server_domain}}</th>
-                                       <th>{{$l10n.known_contacts}}</th>
-                               </tr>
-                       </thead>
-                       <tfoot>
-                               <tr>
-                                       <td colspan="4">{{$l10n.server_count}}</td>
-                               </tr>
-                       </tfoot>
-                       <tbody>
-            {{foreach $gservers as $gserver}}
-                               <tr>
-                                       <td class="text-center">
-                                               <span class="network-label icon" alt="{{$gserver.network_name}}" title="{{$gserver.network_name}}">
-                                                       <i class="fa fa-{{$gserver.network_icon}}"></i>
-                                               </span>
-                                       </td>
-                                       <th>{{$gserver.site_name|default:$gserver.domain}}</th>
-                                       <td>
-                                               <a href="{{$gserver.url}}" target="_blank" rel="noreferrer noopener">{{$gserver.domain}} <i class="fa fa-external-link"></i></a>
-                                       </td>
-                                       <td class="text-right">{{$gserver.contacts}} <i class="fa fa-user"></i></td>
-                               </tr>
-            {{/foreach}}
-                       </tbody>
-               </table>
-
-               {{include file="field_checkbox.tpl" field=$newpurge}}
-               {{include file="field_input.tpl" field=$newreason}}
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary" name="page_blocklist_add" value="{{$l10n.add_pattern}}">{{$l10n.add_pattern}}</button>
-               </div>
-       </form>
-{{/if}}
-</div>
diff --git a/view/templates/admin/blocklist/server/import.tpl b/view/templates/admin/blocklist/server/import.tpl
deleted file mode 100644 (file)
index cdce214..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<div id="adminpage">
-       <p><a href="{{$baseurl}}/admin/blocklist/server">{{$l10n.return_list}}</a></p>
-       <h1>{{$l10n.title}} - {{$l10n.page}}</h1>
-{{if !$blocklist}}
-    {{$l10n.download nofilter}}
-
-       <form action="{{$baseurl}}/admin/blocklist/server/import" method="post" enctype="multipart/form-data">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-        {{include file="field_input.tpl" field=$listfile}}
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary" name="page_blocklist_upload" value="{{$l10n.upload}}">{{$l10n.upload}}</button>
-               </div>
-       </form>
-{{else}}
-       <h2>{{$l10n.patterns}}</h2>
-       <form action="{{$baseurl}}/admin/blocklist/server/import" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-        <input type="hidden" name="blocklist" value="{{$blocklist|json_encode}}">
-               <table class="table table-condensed table-striped table-bordered">
-                       <thead>
-                               <tr>
-                                       <th>{{$l10n.domain_pattern}}</th>
-                                       <th>{{$l10n.block_reason}}</th>
-                               </tr>
-                       </thead>
-                       <tfoot>
-                               <tr>
-                                       <td colspan="4">{{$l10n.pattern_count}}</td>
-                               </tr>
-                       </tfoot>
-                       <tbody>
-            {{foreach $blocklist as $block}}
-                               <tr>
-                                       <th>{{$block.domain}}</th>
-                                       <td>{{$block.reason}}</td>
-                               </tr>
-            {{/foreach}}
-                       </tbody>
-               </table>
-
-               <div role="radiogroup" aria-labelledby="mode">
-                       <label id="mode">{{$l10n.mode}}</label>
-            {{include file="field_radio.tpl" field=$mode_append}}
-            {{include file="field_radio.tpl" field=$mode_replace}}
-               </div>
-
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary" name="page_blocklist_import" value="{{$l10n.import}}">{{$l10n.import}}</button>
-               </div>
-       </form>
-{{/if}}
-</div>
diff --git a/view/templates/admin/blocklist/server/index.tpl b/view/templates/admin/blocklist/server/index.tpl
deleted file mode 100644 (file)
index bfb269e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<script>
-       function confirm_delete(uname){
-               return confirm("{{$l10n.confirm_delete}}".format(uname));
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$l10n.title}} - {{$l10n.page}}</h1>
-       <p>{{$l10n.intro}}</p>
-       <p>{{$l10n.public nofilter}}</p>
-
-       <h2>{{$l10n.importtitle}}</h2>
-    {{$l10n.download nofilter}}
-
-       <form action="{{$baseurl}}/admin/blocklist/server/import" method="post" enctype="multipart/form-data">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token_import}}">
-        {{include file="field_input.tpl" field=$listfile}}
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary" name="page_blocklist_upload">{{$l10n.importsubmit}}</button>
-               </div>
-       </form>
-
-       <h2>{{$l10n.addtitle}}</h2>
-    {{$l10n.syntax nofilter}}
-       <form action="{{$baseurl}}/admin/blocklist/server/add" method="get">
-               {{include file="field_input.tpl" field=$newdomain}}
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary">{{$l10n.addsubmit}}</button>
-               </div>
-       </form>
-
-       {{if $entries}}
-       <h2>{{$l10n.currenttitle}}</h2>
-       <form action="{{$baseurl}}/admin/blocklist/server" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               {{foreach $entries as $e}}
-                       {{include file="field_input.tpl" field=$e.domain}}
-                       {{include file="field_input.tpl" field=$e.reason}}
-                       {{include file="field_checkbox.tpl" field=$e.delete}}
-               {{/foreach}}
-               <div class="submit">
-                       <button type="submit" class="btn btn-primary" name="page_blocklist_edit" value="{{$l10n.savechanges}}">{{$l10n.savechanges}}</button>
-               </div>
-               {{/if}}
-       </form>
-</div>
diff --git a/view/templates/admin/item/delete.tpl b/view/templates/admin/item/delete.tpl
deleted file mode 100644 (file)
index 497b776..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}}</h1>
-       <p>{{$intro1}}</p>
-       <p>{{$intro2}}</p>
-
-       <form action="{{$baseurl}}/admin/item/delete" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               {{include file="field_input.tpl" field=$deleteitemguid}}
-               <div class="submit"><input type="submit" name="page_deleteitem_submit" value="{{$submit}}" /></div>
-       </form>
-
-</div>
diff --git a/view/templates/admin/item/source.tpl b/view/templates/admin/item/source.tpl
deleted file mode 100644 (file)
index 41e613b..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<div id="source" class="generic-page-wrapper">
-       <h2>{{$title}}</h2>
-       <form action="admin/item/source" method="get" class="panel panel-default">
-               <div class="panel-body">
-                       <div class="form-group">
-                               {{include file="field_input.tpl" field=$guid}}
-                       </div>
-                       <p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
-               </div>
-       </form>
-
-       {{if $source}}
-       <div class="itemsource-results">
-               <div class="panel panel-default">
-                       <div class="panel-heading">
-                               <h3 class="panel-title">{{$itemidlbl}}</h3>
-                       </div>
-                       <div class="panel-body">
-                               {{$item_id}}
-                       </div>
-               </div>
-               <div class="panel panel-default">
-                       <div class="panel-heading">
-                               <h3 class="panel-title">{{$itemurilbl}}</h3>
-                       </div>
-                       <div class="panel-body">
-                               {{$item_uri}}
-                       </div>
-               </div>
-               <div class="panel panel-default">
-                       <div class="panel-heading">
-                               <h3 class="panel-title">{{$termslbl}}</h3>
-                       </div>
-                       <div class="panel-body">
-                               <table class="table table-condensed table-striped">
-                                       <tr>
-                                               <th>{{$typelbl}}</th>
-                                               <th>{{$termlbl}}</th>
-                                               <th>{{$urllbl}}</th>
-                                       </tr>
-                       {{foreach $terms as $term}}
-                                       <tr>
-                                               <td>
-                               {{if $term.type == 1}}{{$tag}}{{/if}}
-                               {{if $term.type == 2}}{{$mentionlbl}}{{/if}}
-                               {{if $term.type == 8}}{{$implicitlbl}}{{/if}}
-                                               </td>
-                                               <td>
-                                                       {{$term.name}}
-                                               </td>
-                                               <td>
-                                                       {{$term.url}}
-                                               </td>
-                                       </tr>
-                       {{/foreach}}
-                               </table>
-                       </div>
-               </div>
-               <div class="panel panel-default">
-                       <div class="panel-heading">
-                               <h3 class="panel-title">{{$sourcelbl}}</h3>
-                       </div>
-                       <pre><code class="language-php">{{$source}}</code></pre>
-               </div>
-       </div>
-</div>
-{{/if}}
index 2421658d6c035d289f30251f3b3accfa6f1f820a..9e69b673269d7c10a2d0329f26eb5e5c92949829 100644 (file)
                <dt>{{$queues.label}}</dt>
                <dd><a href="{{$baseurl}}/admin/queue/deferred">{{$queues.deferred}}</a> - <a href="{{$baseurl}}/admin/queue">{{$queues.workerq}}</a></dd>
        </dl>
-       <dl>
-               <dt>{{$pending.0}}</dt>
-               <dd>{{$pending.1}}</dt>
-       </dl>
-
-       <dl>
-               <dt>{{$users.0}}</dt>
-               <dd>{{$users.1}}</dd>
-       </dl>
-       {{foreach $accounts as $p}}
-               <dl>
-                       <dt>{{$p.0}}</dt>
-                       <dd>{{if $p.1}}{{$p.1}}{{else}}0{{/if}}</dd>
-               </dl>
-       {{/foreach}}
-
 
        <dl>
                <dt>{{$addons.0}}</dt>
diff --git a/view/templates/admin/users/active.tpl b/view/templates/admin/users/active.tpl
deleted file mode 100644 (file)
index 8ec13e1..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<script>
-       function confirm_delete(uname) {
-               return confirm("{{$confirm_delete}}".format(uname));
-       }
-
-       function confirm_delete_multi() {
-               return confirm("{{$confirm_delete_multi}}");
-       }
-
-       function selectall(cls) {
-               $("." + cls).attr('checked', 'checked');
-               return false;
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               <table id="users">
-                       <thead>
-                       <tr>
-                               <th></th>
-                               {{foreach $th_users as $th}}
-                                       <th>
-                                               <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
-                                               {{if $order_users == $th.1}}
-                                                       {{if $order_direction_users == "+"}}
-                                                               &#8595;
-                                                       {{else}}
-                                                               &#8593;
-                                                       {{/if}}
-                                               {{else}}
-                                                       &#8597;
-                                               {{/if}}
-                                                       {{$th.0}}
-                                               </a>
-                                       </th>
-                               {{/foreach}}
-                               <th></th>
-                               <th></th>
-                       </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr>
-                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
-                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
-                                       <td class="email">{{$u.email}}</td>
-                                       <td class="register_date">{{$u.register_date}}</td>
-                                       <td class="login_date">{{$u.login_date}}</td>
-                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
-                                       <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
-                                       <td class="checkbox">
-                                               {{if $u.is_deletable}}
-                                               <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
-                                               {{else}}
-                                                       &nbsp;
-                                               {{/if}}
-                                       </td>
-
-                                       <td class="tools">
-                                               {{if $u.is_deletable}}
-                                                       <a href="{{$baseurl}}/admin/users/active/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
-                                                               <span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
-                                                       </a>
-                                                       <a href="{{$baseurl}}/admin/users/active/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
-                                                               <span class="icon drop"></span>
-                                                       </a>
-                                               {{else}}
-                                                       &nbsp;
-                                               {{/if}}
-                                       </td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
-               <div class="submit">
-                       <input type="submit" name="page_users_block" value="{{$block}}"/>
-                       <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
-               </div>
-       </form>
-       {{$pager nofilter}}
-       <p>
-               <a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
-       </p>
-</div>
diff --git a/view/templates/admin/users/blocked.tpl b/view/templates/admin/users/blocked.tpl
deleted file mode 100644 (file)
index 6defaf6..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<script>
-       function confirm_delete(uname) {
-               return confirm("{{$confirm_delete}}".format(uname));
-       }
-
-       function confirm_delete_multi() {
-               return confirm("{{$confirm_delete_multi}}");
-       }
-
-       function selectall(cls) {
-               $("." + cls).attr('checked', 'checked');
-               return false;
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               <table id="users">
-                       <thead>
-                       <tr>
-                               <th></th>
-                               {{foreach $th_users as $th}}
-                                       <th>
-                                               <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
-                                               {{if $order_users == $th.1}}
-                                                       {{if $order_direction_users == "+"}}
-                                                               &#8595;
-                                                       {{else}}
-                                                               &#8593;
-                                                       {{/if}}
-                                               {{else}}
-                                                       &#8597;
-                                               {{/if}}
-                                                       {{$th.0}}
-                                               </a>
-                                       </th>
-                               {{/foreach}}
-                               <th></th>
-                               <th></th>
-                       </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr>
-                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
-                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
-                                       <td class="email">{{$u.email}}</td>
-                                       <td class="register_date">{{$u.register_date}}</td>
-                                       <td class="login_date">{{$u.login_date}}</td>
-                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
-                                       <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
-                                       <td class="checkbox">
-                                               {{if $u.is_deletable}}
-                                               <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
-                                               {{else}}
-                                                       &nbsp;
-                                               {{/if}}
-                                       </td>
-
-                                       <td class="tools">
-                                               {{if $u.is_deletable}}
-                                                       <a href="{{$baseurl}}/admin/users/blocked/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
-                                                               <span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
-                                                       </a>
-                                                       <a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
-                                                               <span class="icon drop"></span>
-                                                       </a>
-                                               {{else}}
-                                                       &nbsp;
-                                               {{/if}}
-                                       </td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
-               <div class="submit">
-                       <input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
-                       <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
-               </div>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/templates/admin/users/create.tpl b/view/templates/admin/users/create.tpl
deleted file mode 100644 (file)
index 8581f1b..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}}</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               <table id="users">
-                       <tbody>
-                       <tr>
-                               <td>{{include file="field_input.tpl" field=$newusername}}</td>
-                       </tr>
-                       <tr>
-                               <td>{{include file="field_input.tpl" field=$newusernickname}}</td>
-                       </tr>
-                       <tr>
-                               <td>{{include file="field_input.tpl" field=$newuseremail}}</td>
-                       </tr>
-                       </tbody>
-               </table>
-               <div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
-       </form>
-</div>
diff --git a/view/templates/admin/users/deleted.tpl b/view/templates/admin/users/deleted.tpl
deleted file mode 100644 (file)
index ae43400..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<script>
-       function confirm_delete(uname) {
-               return confirm("{{$confirm_delete}}".format(uname));
-       }
-
-       function confirm_delete_multi() {
-               return confirm("{{$confirm_delete_multi}}");
-       }
-
-       function selectall(cls) {
-               $("." + cls).attr('checked', 'checked');
-               return false;
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               <table id="deleted">
-                       <thead>
-                       <tr>
-                               <th></th>
-                       {{foreach $th_deleted as $th}}
-                               <th>{{$th}}</th>
-                       {{/foreach}}
-                       </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr>
-                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
-                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
-                                       <td class="email">{{$u.email}}</td>
-                                       <td class="register_date">{{$u.register_date}}</td>
-                                       <td class="login_date">{{$u.login_date}}</td>
-                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
-                                       <td class="login_date">{{$u.deleted}}</td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/templates/admin/users/index.tpl b/view/templates/admin/users/index.tpl
deleted file mode 100644 (file)
index 091940c..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<script>
-       function confirm_delete(uname) {
-               return confirm("{{$confirm_delete}}".format(uname));
-       }
-
-       function confirm_delete_multi() {
-               return confirm("{{$confirm_delete_multi}}");
-       }
-
-       function selectall(cls) {
-               $("." + cls).attr('checked', 'checked');
-               return false;
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               <table id="users">
-                       <thead>
-                       <tr>
-                               <th></th>
-                               {{foreach $th_users as $th}}
-                                       <th>
-                                               <a href="{{$baseurl}}/admin/users?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
-                                               {{if $order_users == $th.1}}
-                                                       {{if $order_direction_users == "+"}}
-                                                               &#8595;
-                                                       {{else}}
-                                                               &#8593;
-                                                       {{/if}}
-                                               {{else}}
-                                                       &#8597;
-                                               {{/if}}
-                                                       {{$th.0}}
-                                               </a>
-                                       </th>
-                               {{/foreach}}
-                               <th></th>
-                               <th></th>
-                       </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr>
-                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
-                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
-                                       <td class="email">{{$u.email}}</td>
-                                       <td class="register_date">{{$u.register_date}}</td>
-                                       <td class="login_date">{{$u.login_date}}</td>
-                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
-                                       <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
-                                       <td class="checkbox">
-                                               {{if $u.is_deletable}}
-                                               <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
-                                               {{else}}
-                                                       &nbsp;
-                                               {{/if}}
-                                       </td>
-
-                                       <td class="tools">
-                                               {{if $u.is_deletable}}
-                                                       <a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
-                                                               <span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
-                                                       </a>
-                                                       <a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
-                                                               <span class="icon drop"></span>
-                                                       </a>
-                                               {{else}}
-                                                       &nbsp;
-                                               {{/if}}
-                                       </td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
-               <div class="submit">
-                       <input type="submit" name="page_users_block" value="{{$block}}"/>
-                       <input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
-                       <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
-               </div>
-       </form>
-       {{$pager nofilter}}
-       <p>
-               <a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
-       </p>
-</div>
diff --git a/view/templates/admin/users/pending.tpl b/view/templates/admin/users/pending.tpl
deleted file mode 100644 (file)
index 43d1e52..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<script>
-       function confirm_delete(uname) {
-               return confirm("{{$confirm_delete}}".format(uname));
-       }
-
-       function confirm_delete_multi() {
-               return confirm("{{$confirm_delete_multi}}");
-       }
-
-       function selectall(cls) {
-               $("." + cls).attr('checked', 'checked');
-               return false;
-       }
-</script>
-<div id="adminpage">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-       {{if $pending}}
-               <table id="pending">
-                       <thead>
-                       <tr>
-                               {{foreach $th_pending as $th}}
-                                       <th>{{$th}}</th>{{/foreach}}
-                               <th></th>
-                               <th></th>
-                       </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $pending as $u}}
-                               <tr>
-                                       <td class="created">{{$u.created}}</td>
-                                       <td class="name">{{$u.name}}</td>
-                                       <td class="email">{{$u.email}}</td>
-                                       <td class="checkbox">
-                                               <input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
-                                       </td>
-                                       <td class="tools">
-                                               <a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
-                                                       <span class="icon like"></span>
-                                               </a>
-                                               <a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
-                                                       <span class="icon dislike"></span>
-                                               </a>
-                                       </td>
-                               </tr>
-                               <tr>
-                                       <td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
-               <div class="submit">
-                       <input type="submit" name="page_users_deny" value="{{$deny}}"/>
-                       <input type="submit" name="page_users_approve" value="{{$approve}}"/>
-               </div>
-       {{else}}
-               <p>{{$no_pending}}</p>
-       {{/if}}
-       </form>
-</div>
diff --git a/view/templates/moderation/aside.tpl b/view/templates/moderation/aside.tpl
new file mode 100644 (file)
index 0000000..38f5392
--- /dev/null
@@ -0,0 +1,21 @@
+<script>
+       // update pending count //
+       $(function(){
+
+               $("nav").bind('nav-update',  function(e,data){
+                       var elm = $('#pending-update');
+                       var register = $(data).find('register').html();
+                       if (register=="0") { register=""; elm.hide();} else { elm.show(); }
+                       elm.html(register);
+               });
+       });
+</script>
+
+{{foreach $subpages as $page}}
+<h4>{{$page.0}}</h4>
+<ul class="admin linklist" role="menu">
+{{foreach $page.1 as $item}}
+       <li class='admin link button {{$item.2}}' role="menuitem"><a href='{{$item.0}}'>{{$item.1}}</a></li>
+{{/foreach}}
+</ul>
+{{/foreach}}
diff --git a/view/templates/moderation/blocklist/contact.tpl b/view/templates/moderation/blocklist/contact.tpl
new file mode 100644 (file)
index 0000000..f12eed7
--- /dev/null
@@ -0,0 +1,67 @@
+<script>
+       function selectall(cls) {
+               $('.' + cls).prop('checked', true);
+               return false;
+       }
+       function selectnone(cls) {
+               $('.' + cls).prop('checked', false);
+               return false;
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}}</h1>
+       <p>{{$description nofilter}}</p>
+       <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
+        <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               <h3>{{$h_contacts}}</h3>
+       {{if $contacts}}
+               <table id="contactblock">
+                       <thead>
+                               <tr>
+                                       <th></th>
+                                               {{foreach $th_contacts as $th}}
+                                       <th>
+                                               {{$th}}
+                                       </th>
+                                       {{/foreach}}
+                               </tr>
+                       </thead>
+                       <tbody>
+                               {{foreach $contacts as $contact}}
+                               <tr>
+                                       <td class="checkbox"><input type="checkbox" class="contacts_ckbx" id="id_contact_{{$contact.id}}" name="contacts[]" value="{{$contact.id}}"/></td>
+                                       <td><img class="icon" src="{{$contact.micro}}" alt="{{$contact.nickname}}" title="{{$contact.nickname}}"></td>
+                                       <td class="name">
+                                               {{$contact.name}}<br>
+                                               <a href="{{$contact.url}}" title="{{$contact.nickname}}">{{$contact.addr}}</a>
+                                       </td>
+                                       <td class="reason">{{if $contact.block_reason}}{{$contact.block_reason}}{{else}}N/A{{/if}}</td>
+                               </tr>
+                               {{/foreach}}
+                       </tbody>
+               </table>
+               <p><a href="#" onclick="return selectall('contacts_ckbx');">{{$select_all}}</a> | <a href="#" onclick="return selectnone('contacts_ckbx');">{{$select_none}}</a></p>
+               {{$paginate nofilter}}
+               <div class="submit"><input type="submit" name="page_contactblock_unblock" value="{{$unblock}}" /></div>
+       {{else}}
+               <p>{{$no_data}}</p>
+       {{/if}}
+       </form>
+
+       <h3>{{$h_newblock}}</h3>
+       <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               <table id="contactblock">
+                       <tbody>
+                               <tr>
+                                       <td>{{include file="field_input.tpl" field=$contacturl}}</td>
+                                       <td>{{include file="field_checkbox.tpl" field=$contact_block_purge}}</td>
+                                       <td>{{include file="field_textarea.tpl" field=$contact_block_reason}}</td>
+                               </tr>
+                       </tbody>
+               </table>
+               <div class="submit"><input type="submit" name="page_contactblock_block" value="{{$submit}}" /></div>
+       </form>
+</div>
+
diff --git a/view/templates/moderation/blocklist/server/add.tpl b/view/templates/moderation/blocklist/server/add.tpl
new file mode 100644 (file)
index 0000000..999965d
--- /dev/null
@@ -0,0 +1,56 @@
+<div id="adminpage">
+       <p><a href="{{$baseurl}}/admin/blocklist/server">{{$l10n.return_list}}</a></p>
+       <h1>{{$l10n.title}} - {{$l10n.page}}</h1>
+       {{$l10n.syntax nofilter}}
+
+       <form action="{{$baseurl}}/admin/blocklist/server/add" method="get">
+               {{include file="field_input.tpl" field=$newdomain}}
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary">{{$l10n.submit}}</button>
+               </div>
+       </form>
+{{if $pattern}}
+       <h2>{{$l10n.matching_servers}}</h2>
+       <form action="{{$baseurl}}/admin/blocklist/server/add" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+        <input type="hidden" name="pattern" value="{{$pattern}}">
+               <table class="table table-condensed table-striped table-bordered">
+                       <thead>
+                               <tr>
+                                       <th></th>
+                                       <th>{{$l10n.server_name}}</th>
+                                       <th>{{$l10n.server_domain}}</th>
+                                       <th>{{$l10n.known_contacts}}</th>
+                               </tr>
+                       </thead>
+                       <tfoot>
+                               <tr>
+                                       <td colspan="4">{{$l10n.server_count}}</td>
+                               </tr>
+                       </tfoot>
+                       <tbody>
+            {{foreach $gservers as $gserver}}
+                               <tr>
+                                       <td class="text-center">
+                                               <span class="network-label icon" alt="{{$gserver.network_name}}" title="{{$gserver.network_name}}">
+                                                       <i class="fa fa-{{$gserver.network_icon}}"></i>
+                                               </span>
+                                       </td>
+                                       <th>{{$gserver.site_name|default:$gserver.domain}}</th>
+                                       <td>
+                                               <a href="{{$gserver.url}}" target="_blank" rel="noreferrer noopener">{{$gserver.domain}} <i class="fa fa-external-link"></i></a>
+                                       </td>
+                                       <td class="text-right">{{$gserver.contacts}} <i class="fa fa-user"></i></td>
+                               </tr>
+            {{/foreach}}
+                       </tbody>
+               </table>
+
+               {{include file="field_checkbox.tpl" field=$newpurge}}
+               {{include file="field_input.tpl" field=$newreason}}
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary" name="page_blocklist_add" value="{{$l10n.add_pattern}}">{{$l10n.add_pattern}}</button>
+               </div>
+       </form>
+{{/if}}
+</div>
diff --git a/view/templates/moderation/blocklist/server/import.tpl b/view/templates/moderation/blocklist/server/import.tpl
new file mode 100644 (file)
index 0000000..cdce214
--- /dev/null
@@ -0,0 +1,52 @@
+<div id="adminpage">
+       <p><a href="{{$baseurl}}/admin/blocklist/server">{{$l10n.return_list}}</a></p>
+       <h1>{{$l10n.title}} - {{$l10n.page}}</h1>
+{{if !$blocklist}}
+    {{$l10n.download nofilter}}
+
+       <form action="{{$baseurl}}/admin/blocklist/server/import" method="post" enctype="multipart/form-data">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+        {{include file="field_input.tpl" field=$listfile}}
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary" name="page_blocklist_upload" value="{{$l10n.upload}}">{{$l10n.upload}}</button>
+               </div>
+       </form>
+{{else}}
+       <h2>{{$l10n.patterns}}</h2>
+       <form action="{{$baseurl}}/admin/blocklist/server/import" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+        <input type="hidden" name="blocklist" value="{{$blocklist|json_encode}}">
+               <table class="table table-condensed table-striped table-bordered">
+                       <thead>
+                               <tr>
+                                       <th>{{$l10n.domain_pattern}}</th>
+                                       <th>{{$l10n.block_reason}}</th>
+                               </tr>
+                       </thead>
+                       <tfoot>
+                               <tr>
+                                       <td colspan="4">{{$l10n.pattern_count}}</td>
+                               </tr>
+                       </tfoot>
+                       <tbody>
+            {{foreach $blocklist as $block}}
+                               <tr>
+                                       <th>{{$block.domain}}</th>
+                                       <td>{{$block.reason}}</td>
+                               </tr>
+            {{/foreach}}
+                       </tbody>
+               </table>
+
+               <div role="radiogroup" aria-labelledby="mode">
+                       <label id="mode">{{$l10n.mode}}</label>
+            {{include file="field_radio.tpl" field=$mode_append}}
+            {{include file="field_radio.tpl" field=$mode_replace}}
+               </div>
+
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary" name="page_blocklist_import" value="{{$l10n.import}}">{{$l10n.import}}</button>
+               </div>
+       </form>
+{{/if}}
+</div>
diff --git a/view/templates/moderation/blocklist/server/index.tpl b/view/templates/moderation/blocklist/server/index.tpl
new file mode 100644 (file)
index 0000000..bfb269e
--- /dev/null
@@ -0,0 +1,45 @@
+<script>
+       function confirm_delete(uname){
+               return confirm("{{$l10n.confirm_delete}}".format(uname));
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$l10n.title}} - {{$l10n.page}}</h1>
+       <p>{{$l10n.intro}}</p>
+       <p>{{$l10n.public nofilter}}</p>
+
+       <h2>{{$l10n.importtitle}}</h2>
+    {{$l10n.download nofilter}}
+
+       <form action="{{$baseurl}}/admin/blocklist/server/import" method="post" enctype="multipart/form-data">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token_import}}">
+        {{include file="field_input.tpl" field=$listfile}}
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary" name="page_blocklist_upload">{{$l10n.importsubmit}}</button>
+               </div>
+       </form>
+
+       <h2>{{$l10n.addtitle}}</h2>
+    {{$l10n.syntax nofilter}}
+       <form action="{{$baseurl}}/admin/blocklist/server/add" method="get">
+               {{include file="field_input.tpl" field=$newdomain}}
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary">{{$l10n.addsubmit}}</button>
+               </div>
+       </form>
+
+       {{if $entries}}
+       <h2>{{$l10n.currenttitle}}</h2>
+       <form action="{{$baseurl}}/admin/blocklist/server" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               {{foreach $entries as $e}}
+                       {{include file="field_input.tpl" field=$e.domain}}
+                       {{include file="field_input.tpl" field=$e.reason}}
+                       {{include file="field_checkbox.tpl" field=$e.delete}}
+               {{/foreach}}
+               <div class="submit">
+                       <button type="submit" class="btn btn-primary" name="page_blocklist_edit" value="{{$l10n.savechanges}}">{{$l10n.savechanges}}</button>
+               </div>
+               {{/if}}
+       </form>
+</div>
diff --git a/view/templates/moderation/item/delete.tpl b/view/templates/moderation/item/delete.tpl
new file mode 100644 (file)
index 0000000..497b776
--- /dev/null
@@ -0,0 +1,12 @@
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}}</h1>
+       <p>{{$intro1}}</p>
+       <p>{{$intro2}}</p>
+
+       <form action="{{$baseurl}}/admin/item/delete" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               {{include file="field_input.tpl" field=$deleteitemguid}}
+               <div class="submit"><input type="submit" name="page_deleteitem_submit" value="{{$submit}}" /></div>
+       </form>
+
+</div>
diff --git a/view/templates/moderation/item/source.tpl b/view/templates/moderation/item/source.tpl
new file mode 100644 (file)
index 0000000..41e613b
--- /dev/null
@@ -0,0 +1,67 @@
+<div id="source" class="generic-page-wrapper">
+       <h2>{{$title}}</h2>
+       <form action="admin/item/source" method="get" class="panel panel-default">
+               <div class="panel-body">
+                       <div class="form-group">
+                               {{include file="field_input.tpl" field=$guid}}
+                       </div>
+                       <p><button type="submit" class="btn btn-primary">{{$submit}}</button></p>
+               </div>
+       </form>
+
+       {{if $source}}
+       <div class="itemsource-results">
+               <div class="panel panel-default">
+                       <div class="panel-heading">
+                               <h3 class="panel-title">{{$itemidlbl}}</h3>
+                       </div>
+                       <div class="panel-body">
+                               {{$item_id}}
+                       </div>
+               </div>
+               <div class="panel panel-default">
+                       <div class="panel-heading">
+                               <h3 class="panel-title">{{$itemurilbl}}</h3>
+                       </div>
+                       <div class="panel-body">
+                               {{$item_uri}}
+                       </div>
+               </div>
+               <div class="panel panel-default">
+                       <div class="panel-heading">
+                               <h3 class="panel-title">{{$termslbl}}</h3>
+                       </div>
+                       <div class="panel-body">
+                               <table class="table table-condensed table-striped">
+                                       <tr>
+                                               <th>{{$typelbl}}</th>
+                                               <th>{{$termlbl}}</th>
+                                               <th>{{$urllbl}}</th>
+                                       </tr>
+                       {{foreach $terms as $term}}
+                                       <tr>
+                                               <td>
+                               {{if $term.type == 1}}{{$tag}}{{/if}}
+                               {{if $term.type == 2}}{{$mentionlbl}}{{/if}}
+                               {{if $term.type == 8}}{{$implicitlbl}}{{/if}}
+                                               </td>
+                                               <td>
+                                                       {{$term.name}}
+                                               </td>
+                                               <td>
+                                                       {{$term.url}}
+                                               </td>
+                                       </tr>
+                       {{/foreach}}
+                               </table>
+                       </div>
+               </div>
+               <div class="panel panel-default">
+                       <div class="panel-heading">
+                               <h3 class="panel-title">{{$sourcelbl}}</h3>
+                       </div>
+                       <pre><code class="language-php">{{$source}}</code></pre>
+               </div>
+       </div>
+</div>
+{{/if}}
diff --git a/view/templates/moderation/settings_head.tpl b/view/templates/moderation/settings_head.tpl
new file mode 100644 (file)
index 0000000..25c0f80
--- /dev/null
@@ -0,0 +1,9 @@
+<script>
+       $(document).ready(function() {
+               $('.settings-content-block').hide();
+               $('.settings-heading').click(function(){
+                       $('.settings-content-block').hide();
+                       $(this).next('.settings-content-block').toggle();
+               });
+       });
+</script>
diff --git a/view/templates/moderation/summary.tpl b/view/templates/moderation/summary.tpl
new file mode 100644 (file)
index 0000000..8769dcd
--- /dev/null
@@ -0,0 +1,16 @@
+
+<div id='adminpage'>
+       <h1>{{$title}} - {{$page}}</h1>
+
+       <dl>
+               <dt>{{$users.0}}</dt>
+               <dd>{{$users.1}}</dd>
+       </dl>
+       {{foreach $accounts as $p}}
+               <dl>
+                       <dt>{{$p.0}}</dt>
+                       <dd>{{if $p.1}}{{$p.1}}{{else}}0{{/if}}</dd>
+               </dl>
+       {{/foreach}}
+
+</div>
diff --git a/view/templates/moderation/users/active.tpl b/view/templates/moderation/users/active.tpl
new file mode 100644 (file)
index 0000000..8ec13e1
--- /dev/null
@@ -0,0 +1,88 @@
+<script>
+       function confirm_delete(uname) {
+               return confirm("{{$confirm_delete}}".format(uname));
+       }
+
+       function confirm_delete_multi() {
+               return confirm("{{$confirm_delete_multi}}");
+       }
+
+       function selectall(cls) {
+               $("." + cls).attr('checked', 'checked');
+               return false;
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               <table id="users">
+                       <thead>
+                       <tr>
+                               <th></th>
+                               {{foreach $th_users as $th}}
+                                       <th>
+                                               <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
+                                               {{if $order_users == $th.1}}
+                                                       {{if $order_direction_users == "+"}}
+                                                               &#8595;
+                                                       {{else}}
+                                                               &#8593;
+                                                       {{/if}}
+                                               {{else}}
+                                                       &#8597;
+                                               {{/if}}
+                                                       {{$th.0}}
+                                               </a>
+                                       </th>
+                               {{/foreach}}
+                               <th></th>
+                               <th></th>
+                       </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr>
+                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
+                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
+                                       <td class="email">{{$u.email}}</td>
+                                       <td class="register_date">{{$u.register_date}}</td>
+                                       <td class="login_date">{{$u.login_date}}</td>
+                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
+                                       <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
+                                       <td class="checkbox">
+                                               {{if $u.is_deletable}}
+                                               <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
+                                               {{else}}
+                                                       &nbsp;
+                                               {{/if}}
+                                       </td>
+
+                                       <td class="tools">
+                                               {{if $u.is_deletable}}
+                                                       <a href="{{$baseurl}}/admin/users/active/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
+                                                               <span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
+                                                       </a>
+                                                       <a href="{{$baseurl}}/admin/users/active/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
+                                                               <span class="icon drop"></span>
+                                                       </a>
+                                               {{else}}
+                                                       &nbsp;
+                                               {{/if}}
+                                       </td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
+               <div class="submit">
+                       <input type="submit" name="page_users_block" value="{{$block}}"/>
+                       <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
+               </div>
+       </form>
+       {{$pager nofilter}}
+       <p>
+               <a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
+       </p>
+</div>
diff --git a/view/templates/moderation/users/blocked.tpl b/view/templates/moderation/users/blocked.tpl
new file mode 100644 (file)
index 0000000..6defaf6
--- /dev/null
@@ -0,0 +1,86 @@
+<script>
+       function confirm_delete(uname) {
+               return confirm("{{$confirm_delete}}".format(uname));
+       }
+
+       function confirm_delete_multi() {
+               return confirm("{{$confirm_delete_multi}}");
+       }
+
+       function selectall(cls) {
+               $("." + cls).attr('checked', 'checked');
+               return false;
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               <table id="users">
+                       <thead>
+                       <tr>
+                               <th></th>
+                               {{foreach $th_users as $th}}
+                                       <th>
+                                               <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
+                                               {{if $order_users == $th.1}}
+                                                       {{if $order_direction_users == "+"}}
+                                                               &#8595;
+                                                       {{else}}
+                                                               &#8593;
+                                                       {{/if}}
+                                               {{else}}
+                                                       &#8597;
+                                               {{/if}}
+                                                       {{$th.0}}
+                                               </a>
+                                       </th>
+                               {{/foreach}}
+                               <th></th>
+                               <th></th>
+                       </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr>
+                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
+                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
+                                       <td class="email">{{$u.email}}</td>
+                                       <td class="register_date">{{$u.register_date}}</td>
+                                       <td class="login_date">{{$u.login_date}}</td>
+                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
+                                       <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
+                                       <td class="checkbox">
+                                               {{if $u.is_deletable}}
+                                               <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
+                                               {{else}}
+                                                       &nbsp;
+                                               {{/if}}
+                                       </td>
+
+                                       <td class="tools">
+                                               {{if $u.is_deletable}}
+                                                       <a href="{{$baseurl}}/admin/users/blocked/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
+                                                               <span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
+                                                       </a>
+                                                       <a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
+                                                               <span class="icon drop"></span>
+                                                       </a>
+                                               {{else}}
+                                                       &nbsp;
+                                               {{/if}}
+                                       </td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
+               <div class="submit">
+                       <input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
+                       <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
+               </div>
+               {{$pager nofilter}}
+       </form>
+</div>
diff --git a/view/templates/moderation/users/create.tpl b/view/templates/moderation/users/create.tpl
new file mode 100644 (file)
index 0000000..8581f1b
--- /dev/null
@@ -0,0 +1,21 @@
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}}</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               <table id="users">
+                       <tbody>
+                       <tr>
+                               <td>{{include file="field_input.tpl" field=$newusername}}</td>
+                       </tr>
+                       <tr>
+                               <td>{{include file="field_input.tpl" field=$newusernickname}}</td>
+                       </tr>
+                       <tr>
+                               <td>{{include file="field_input.tpl" field=$newuseremail}}</td>
+                       </tr>
+                       </tbody>
+               </table>
+               <div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
+       </form>
+</div>
diff --git a/view/templates/moderation/users/deleted.tpl b/view/templates/moderation/users/deleted.tpl
new file mode 100644 (file)
index 0000000..ae43400
--- /dev/null
@@ -0,0 +1,46 @@
+<script>
+       function confirm_delete(uname) {
+               return confirm("{{$confirm_delete}}".format(uname));
+       }
+
+       function confirm_delete_multi() {
+               return confirm("{{$confirm_delete_multi}}");
+       }
+
+       function selectall(cls) {
+               $("." + cls).attr('checked', 'checked');
+               return false;
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               <table id="deleted">
+                       <thead>
+                       <tr>
+                               <th></th>
+                       {{foreach $th_deleted as $th}}
+                               <th>{{$th}}</th>
+                       {{/foreach}}
+                       </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr>
+                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
+                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
+                                       <td class="email">{{$u.email}}</td>
+                                       <td class="register_date">{{$u.register_date}}</td>
+                                       <td class="login_date">{{$u.login_date}}</td>
+                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
+                                       <td class="login_date">{{$u.deleted}}</td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               {{$pager nofilter}}
+       </form>
+</div>
diff --git a/view/templates/moderation/users/index.tpl b/view/templates/moderation/users/index.tpl
new file mode 100644 (file)
index 0000000..091940c
--- /dev/null
@@ -0,0 +1,89 @@
+<script>
+       function confirm_delete(uname) {
+               return confirm("{{$confirm_delete}}".format(uname));
+       }
+
+       function confirm_delete_multi() {
+               return confirm("{{$confirm_delete_multi}}");
+       }
+
+       function selectall(cls) {
+               $("." + cls).attr('checked', 'checked');
+               return false;
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               <table id="users">
+                       <thead>
+                       <tr>
+                               <th></th>
+                               {{foreach $th_users as $th}}
+                                       <th>
+                                               <a href="{{$baseurl}}/admin/users?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
+                                               {{if $order_users == $th.1}}
+                                                       {{if $order_direction_users == "+"}}
+                                                               &#8595;
+                                                       {{else}}
+                                                               &#8593;
+                                                       {{/if}}
+                                               {{else}}
+                                                       &#8597;
+                                               {{/if}}
+                                                       {{$th.0}}
+                                               </a>
+                                       </th>
+                               {{/foreach}}
+                               <th></th>
+                               <th></th>
+                       </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr>
+                                       <td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
+                                       <td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
+                                       <td class="email">{{$u.email}}</td>
+                                       <td class="register_date">{{$u.register_date}}</td>
+                                       <td class="login_date">{{$u.login_date}}</td>
+                                       <td class="lastitem_date">{{$u.lastitem_date}}</td>
+                                       <td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
+                                       <td class="checkbox">
+                                               {{if $u.is_deletable}}
+                                               <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
+                                               {{else}}
+                                                       &nbsp;
+                                               {{/if}}
+                                       </td>
+
+                                       <td class="tools">
+                                               {{if $u.is_deletable}}
+                                                       <a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
+                                                               <span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
+                                                       </a>
+                                                       <a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
+                                                               <span class="icon drop"></span>
+                                                       </a>
+                                               {{else}}
+                                                       &nbsp;
+                                               {{/if}}
+                                       </td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
+               <div class="submit">
+                       <input type="submit" name="page_users_block" value="{{$block}}"/>
+                       <input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
+                       <input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
+               </div>
+       </form>
+       {{$pager nofilter}}
+       <p>
+               <a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
+       </p>
+</div>
diff --git a/view/templates/moderation/users/pending.tpl b/view/templates/moderation/users/pending.tpl
new file mode 100644 (file)
index 0000000..43d1e52
--- /dev/null
@@ -0,0 +1,64 @@
+<script>
+       function confirm_delete(uname) {
+               return confirm("{{$confirm_delete}}".format(uname));
+       }
+
+       function confirm_delete_multi() {
+               return confirm("{{$confirm_delete_multi}}");
+       }
+
+       function selectall(cls) {
+               $("." + cls).attr('checked', 'checked');
+               return false;
+       }
+</script>
+<div id="adminpage">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+       {{if $pending}}
+               <table id="pending">
+                       <thead>
+                       <tr>
+                               {{foreach $th_pending as $th}}
+                                       <th>{{$th}}</th>{{/foreach}}
+                               <th></th>
+                               <th></th>
+                       </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $pending as $u}}
+                               <tr>
+                                       <td class="created">{{$u.created}}</td>
+                                       <td class="name">{{$u.name}}</td>
+                                       <td class="email">{{$u.email}}</td>
+                                       <td class="checkbox">
+                                               <input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
+                                       </td>
+                                       <td class="tools">
+                                               <a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
+                                                       <span class="icon like"></span>
+                                               </a>
+                                               <a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
+                                                       <span class="icon dislike"></span>
+                                               </a>
+                                       </td>
+                               </tr>
+                               <tr>
+                                       <td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
+               <div class="submit">
+                       <input type="submit" name="page_users_deny" value="{{$deny}}"/>
+                       <input type="submit" name="page_users_approve" value="{{$approve}}"/>
+               </div>
+       {{else}}
+               <p>{{$no_pending}}</p>
+       {{/if}}
+       </form>
+</div>
index 3c1b9f26b21d14bf5dbec740e40c72a42e168e14..b7a332d9903ad359ed46b43384979d7d531d3eb0 100644 (file)
@@ -22,6 +22,8 @@
 
        {{if $nav.admin}}<a accesskey="a" id="nav-admin-link" class="nav-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a>{{/if}}
 
+       {{if $nav.moderation}}<a accesskey="m" id="nav-moderation-link" class="nav-link {{$nav.moderation.2}}" href="{{$nav.moderation.0}}" title="{{$nav.moderation.3}}">{{$nav.moderation.1}}</a>{{/if}}
+
        {{if $nav.network}}
        <a accesskey="n" id="nav-network-link" class="nav-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}">{{$nav.network.1}}</a>
        <span id="net-update" class="nav-ajax-left"></span>
index 8e386d5e6a6fe57ca2e51bafd8a9c328bee646f3..b242323fdf842aecb028796f0ae43b2c7ae1e76b 100644 (file)
@@ -22,6 +22,8 @@
 
        {{if $nav.admin}}<a accesskey="a" id="nav-admin-link" class="nav-link {{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a>{{/if}}
 
+       {{if $nav.moderation}}<a accesskey="m" id="nav-moderation-link" class="nav-link {{$nav.moderation.2}}" href="{{$nav.moderation.0}}" title="{{$nav.moderation.3}}">{{$nav.moderation.1}}</a>{{/if}}
+
        {{if $nav.network}}
        <a accesskey="n" id="nav-network-link" class="nav-commlink {{$nav.network.2}} {{$sel.network}}" href="{{$nav.network.0}}" title="{{$nav.network.3}}">{{$nav.network.1}}</a>
        <span id="net-update" class="nav-ajax-left"></span>
diff --git a/view/theme/frio/templates/admin/blocklist/contact.tpl b/view/theme/frio/templates/admin/blocklist/contact.tpl
deleted file mode 100644 (file)
index e6acce2..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
-
-<div id="admin-contactblock" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}}</h1>
-       <p>{{$description nofilter}}</p>
-
-       {{* We organize the settings in collapsable panel-groups *}}
-       <div class="panel-group panel-group-settings" id="admin-settings" role="tablist" aria-multiselectable="true">
-               {{* The form for entering user profile which should be blocked *}}
-               <div class="panel">
-                       <div class="panel-heading section-subtitle-wrapper" role="tab" id="admin-settings-contactblock-block">
-                               <h4>
-                                       <button class="btn-link accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-contactblock-block-collapse" aria-expanded="false" aria-controls="admin-settings-contactblock-block-collapse">
-                                               {{$h_newblock}}
-                                       </button>
-                               </h4>
-                       </div>
-
-                       <div id="admin-settings-contactblock-block-collapse" class="panel-body panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-contactblock-block">
-                               <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
-                                       <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-                                       {{include file="field_input.tpl" field=$contacturl}}
-                                       {{include file="field_checkbox.tpl" field=$contact_block_purge}}
-                                       {{include file="field_textarea.tpl" field=$contact_block_reason}}
-
-                                       <div class="admin-settings-submit-wrapper form-group pull-right">
-                                               <button type="submit" class="btn btn-primary" name="page_contactblock_block" value="1">{{$submit}}</button>
-                                       </div>
-                                       <div class="clear"></div>
-                               </form>
-                       </div>
-               </div>
-
-               {{* The list of blocked user profiles with the possibility to unblock them *}}
-               <div class="panel">
-                       <div class="panel-heading section-subtitle-wrapper" role="tab" id="admin-settings-contactblock-blocked">
-                               <h4>
-                                       <button class="btn-link accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-contactblock-blocked-collapse" aria-expanded="{{if count($contacts) > 0}}true{{else}}false{{/if}}" aria-controls="admin-settings-contactblock-blocked-collapse">
-                                               {{$h_contacts}} ({{$total_contacts}})
-                                       </button>
-                               </h4>
-                       </div>
-
-                       <div id="admin-settings-contactblock-blocked-collapse" class="panel-body panel-collapse collapse {{if count($contacts) > 0}}in{{/if}}" role="tabpanel" aria-labelledby="admin-settings-contactblock-blocked">
-                               <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
-                                       <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-                                       {{if $contacts}}
-                                       <table id="contactblock" class="table table-condensed table-striped">
-                                               <thead>
-                                                       <tr>
-                                                               <th></th>
-                                                               {{foreach $th_contacts as $th}}
-                                                                       <th>
-                                                                               {{$th}}
-                                                                       </th>
-                                                               {{/foreach}}
-                                                       </tr>
-                                               </thead>
-                                               <tbody>
-                                                       {{foreach $contacts as $contact}}
-                                                               <tr>
-                                                                       <td>
-                                                                               <div class="checkbox">
-                                                                                       <input type="checkbox" class="contacts_ckbx" id="id_contact_{{$contact.id}}" name="contacts[]" value="{{$contact.id}}"/>
-                                                                                       <label for="id_contact_{{$contact.id}}"></label>
-                                                                               </div>
-                                                                       </td>
-                                                                       <td><img class="icon" src="{{$contact.micro}}" alt="{{$contact.nickname}}" title="{{$contact.addr}}"></td>
-                                                                       <td class="name">
-                                                                               {{$contact.name}}<br>
-                                                                               <a href="{{$contact.url}}" title="{{$contact.nickname}}">{{$contact.addr}}</a>
-                                                                       </td>
-                                                                       <td class="reason">{{if $contact.block_reason}}{{$contact.block_reason}}{{else}}N/A{{/if}}</td>
-                                                               </tr>
-                                                       {{/foreach}}
-                                               </tbody>
-                                               <tfoot>
-                                                       <tr>
-                                                               <td>
-                                                                       {{* Checkbox to select all blocked contacts *}}
-                                                                       <div class="checkbox">
-                                                                               <input type="checkbox" id="contactblock-select" class="selecttoggle contacts_ckbx" data-select-class="contacts_ckbx" data-select-all="{{$select_all}}" data-select-none="{{$select_none}}" title="{{$select_all}}"/>
-                                                                               <label for="contactblock-select"></label>
-                                                                       </div>
-                                                               </td>
-                                                               <td colspan="3">
-                                                                       {{$total_contacts}}
-                                                                       <div class="admin-settings-submit-wrapper form-group pull-right">
-                                                                               <button type="submit" class="btn btn-small btn-default pull-right" name="page_contactblock_unblock" value="1">{{$unblock}}</button>
-                                                                       </div>
-                                                                       <div class="clear"></div>
-                                                               </td>
-                                                       </tr>
-                                               </tfoot>
-                                       </table>
-
-                                       {{$paginate nofilter}}
-
-                                       {{else}}
-                                       <p>{{$no_data}}</p>
-                                       {{/if}}
-                               </form>
-                       </div>
-               </div>
-       </div>
-</div>
index 6f5645dca7282d9b7bcb8c5c1fbab3baaded5512..78c4f6e35cae8d22123b0e167553c281256d4553 100644 (file)
                        <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry"><a href="{{$baseurl}}/admin/queue/deferred">{{$queues.deferred}}</a> - <a href="{{$baseurl}}/admin/queue">{{$queues.workerq}}</a></div>
                </div>
 
-               {{* Number of pending registrations. *}}
-               <div id="admin-summary-pending" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
-                       <hr class="admin-summary-separator">
-                       <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$pending.0}}</div>
-                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">{{$pending.1}}</div>
-               </div>
-
-               {{* Number of registered users *}}
-               <div id="admin-summary-users" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
-                       <hr class="admin-summary-separator">
-                       <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$users.0}}</div>
-                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">{{$users.1}}</div>
-               </div>
-
-               {{* Account types of registered users. *}}
-               {{foreach $accounts as $p}}
-               <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
-                       <hr class="admin-summary-separator">
-                       <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$p.0}}</div>
-                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">{{if $p.1}}{{$p.1}}{{else}}0{{/if}}</div>
-               </div>
-               {{/foreach}}
-
                {{* List enabled addons. *}}
                <div id="admin-summary-addons" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
                        <hr class="admin-summary-separator">
diff --git a/view/theme/frio/templates/admin/users/active.tpl b/view/theme/frio/templates/admin/users/active.tpl
deleted file mode 100644 (file)
index 7d5ef4d..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
-
-<div id="admin-users" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-       <p>
-               <a href="{{$base_url}}/admin/users/create" class="btn btn-primary"><i class="fa fa-user-plus"></i> {{$h_newuser}}</a>
-       </p>
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               <table id="users" class="table table-hover">
-                       <thead>
-                               <tr>
-                                       <th>
-                                               <div class="checkbox">
-                                                       <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
-                                                       <label for="admin-settings-users-select"></label>
-                                               </div>
-                                       </th>
-                                       <th></th>
-                                       {{foreach $th_users as $k=>$th}}
-                                               {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
-                                               <th class="th-{{$k}}">
-                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
-                                                               {{if $order_users == $th.1}}
-                                                                       {{if $order_direction_users == "+"}}
-                                                                       &#8595;
-                                                                       {{else}}
-                                                                       &#8593;
-                                                                       {{/if}}
-                                                               {{else}}
-                                                               &#8597;
-                                                               {{/if}}
-                                                               {{$th.0}}
-                                                       </a>
-                                               </th>
-                                               {{/if}}
-                                       {{/foreach}}
-                                       <th></th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
-                                       <td>
-                                               {{if $u.is_deletable}}
-                                               <div class="checkbox">
-                                                       <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
-                                                       <label for="id_user_{{$u.uid}}"></label>
-                                               </div>
-                                               {{else}}
-                                               &nbsp;
-                                               {{/if}}
-                                       </td>
-                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
-                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
-                                       <td>{{$u.email}}</td>
-                               {{if $order_users == $th_users.2.1}}
-                                       <td>{{$u.register_date}}</td>
-                               {{/if}}
-
-                               {{if $order_users == $th_users.3.1}}
-                                       <td>{{$u.login_date}}</td>
-                               {{/if}}
-
-                               {{if $order_users == $th_users.4.1}}
-                                       <td>{{$u.lastitem_date}}</td>
-                               {{/if}}
-
-                               {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
-                                       <td>
-                                               <i class="fa
-                                                       {{if $u.page_flags_raw==0}}fa-user{{/if}}               {{* PAGE_NORMAL *}}
-                                                       {{if $u.page_flags_raw==1}}fa-bullhorn{{/if}}           {{* PAGE_SOAPBOX *}}
-                                                       {{if $u.page_flags_raw==2}}fa-users{{/if}}              {{* PAGE_COMMUNITY *}}
-                                                       {{if $u.page_flags_raw==3}}fa-heart{{/if}}              {{* PAGE_FREELOVE *}}
-                                                       {{if $u.page_flags_raw==4}}fa-rss{{/if}}                {{* PAGE_BLOG *}}
-                                                       {{if $u.page_flags_raw==5}}fa-user-secret{{/if}}        {{* PAGE_PRVGROUP *}}
-                                                       " title="{{$u.page_flags}}">
-                                               </i>
-                                               {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
-                                               <i class="fa
-                                                       {{if $u.account_type_raw==1}}fa-sitemap{{/if}}          {{* ACCOUNT_TYPE_ORGANISATION *}}
-                                                       {{if $u.account_type_raw==2}}fa-newspaper-o{{/if}}      {{* ACCOUNT_TYPE_NEWS *}}
-                                                       {{if $u.account_type_raw==3}}fa-comments{{/if}}         {{* ACCOUNT_TYPE_COMMUNITY *}}
-                                                       " title="{{$u.account_type}}">
-                                               </i>
-                                               {{/if}}
-                                               {{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
-                                               {{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
-                                       </td>
-                               {{/if}}
-
-                                       <td class="text-right">
-                                               <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
-                                       </td>
-                               </tr>
-                               <tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
-                                       <td>&nbsp;</td>
-                                       <td colspan="4">
-                                       {{if $order_users != $th_users.2.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
-                                                       &#8597; {{$th_users.2.0}}</a> : {{$u.register_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if $order_users != $th_users.3.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.3.0}}</a> : {{$u.login_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if $order_users != $th_users.4.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.4.0}}</a> : {{$u.lastitem_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.5.0}}</a> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
-                                               </p>
-                                       {{/if}}
-
-                                       </td>
-                                       <td class="text-right">
-                               {{if $u.is_deletable}}
-                                               <a href="{{$baseurl}}/admin/users/active/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
-                                                       <i class="fa fa-ban" aria-hidden="true"></i>
-                                               </a>
-                                               <a href="{{$baseurl}}/admin/users/active/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
-                                                       <i class="fa fa-trash" aria-hidden="true"></i>
-                                               </a>
-                               {{else}}
-                                               &nbsp;
-                               {{/if}}
-                                       </td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="panel-footer">
-                       <button type="submit" name="page_users_block" value="1" class="btn btn-warning">
-                               <i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
-                       </button>
-                       <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
-                               <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
-                       </button>
-               </div>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/theme/frio/templates/admin/users/blocked.tpl b/view/theme/frio/templates/admin/users/blocked.tpl
deleted file mode 100644 (file)
index 1e77c9a..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
-
-<div id="admin-users-blocked" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               <table id="users" class="table table-hover">
-                       <thead>
-                               <tr>
-                                       <th>
-                                               <div class="checkbox">
-                                                       <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
-                                                       <label for="admin-settings-users-select"></label>
-                                               </div>
-                                       </th>
-                                       <th></th>
-                                       {{foreach $th_users as $k=>$th}}
-                                               {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
-                                               <th class="th-{{$k}}">
-                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
-                                                               {{if $order_users == $th.1}}
-                                                                       {{if $order_direction_users == "+"}}
-                                                                       &#8595;
-                                                                       {{else}}
-                                                                       &#8593;
-                                                                       {{/if}}
-                                                               {{else}}
-                                                               &#8597;
-                                                               {{/if}}
-                                                               {{$th.0}}
-                                                       </a>
-                                               </th>
-                                               {{/if}}
-                                       {{/foreach}}
-                                       <th></th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
-                                       <td>
-                                               {{if $u.is_deletable}}
-                                               <div class="checkbox">
-                                                       <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
-                                                       <label for="id_user_{{$u.uid}}"></label>
-                                               </div>
-                                               {{else}}
-                                               &nbsp;
-                                               {{/if}}
-                                       </td>
-                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
-                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
-                                       <td>{{$u.email}}</td>
-                               {{if $order_users == $th_users.2.1}}
-                                       <td>{{$u.register_date}}</td>
-                               {{/if}}
-
-                               {{if $order_users == $th_users.3.1}}
-                                       <td>{{$u.login_date}}</td>
-                               {{/if}}
-
-                               {{if $order_users == $th_users.4.1}}
-                                       <td>{{$u.lastitem_date}}</td>
-                               {{/if}}
-
-                               {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
-                                       <td>
-                                               <i class="fa
-                                                       {{if $u.page_flags_raw==0}}fa-user{{/if}}               {{* PAGE_NORMAL *}}
-                                                       {{if $u.page_flags_raw==1}}fa-bullhorn{{/if}}           {{* PAGE_SOAPBOX *}}
-                                                       {{if $u.page_flags_raw==2}}fa-users{{/if}}              {{* PAGE_COMMUNITY *}}
-                                                       {{if $u.page_flags_raw==3}}fa-heart{{/if}}              {{* PAGE_FREELOVE *}}
-                                                       {{if $u.page_flags_raw==4}}fa-rss{{/if}}                {{* PAGE_BLOG *}}
-                                                       {{if $u.page_flags_raw==5}}fa-user-secret{{/if}}        {{* PAGE_PRVGROUP *}}
-                                                       " title="{{$u.page_flags}}">
-                                               </i>
-                                               {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
-                                               <i class="fa
-                                                       {{if $u.account_type_raw==1}}fa-sitemap{{/if}}          {{* ACCOUNT_TYPE_ORGANISATION *}}
-                                                       {{if $u.account_type_raw==2}}fa-newspaper-o{{/if}}      {{* ACCOUNT_TYPE_NEWS *}}
-                                                       {{if $u.account_type_raw==3}}fa-comments{{/if}}         {{* ACCOUNT_TYPE_COMMUNITY *}}
-                                                       " title="{{$u.account_type}}">
-                                               </i>
-                                               {{/if}}
-                                               {{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
-                                               {{if $u.blocked}}<i class="fa fa-ban text-danger" title="{{$blocked}}"></i>{{/if}}
-                                               {{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
-                                       </td>
-                               {{/if}}
-
-                                       <td class="text-right">
-                                               <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
-                                       </td>
-                               </tr>
-                               <tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
-                                       <td>&nbsp;</td>
-                                       <td colspan="4">
-                                       {{if $order_users != $th_users.2.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
-                                                       &#8597; {{$th_users.2.0}}</a> : {{$u.register_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if $order_users != $th_users.3.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.3.0}}</a> : {{$u.login_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if $order_users != $th_users.4.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.4.0}}</a> : {{$u.lastitem_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.5.0}}</a> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
-                                               </p>
-                                       {{/if}}
-
-                                       </td>
-                                       <td class="text-right">
-                               {{if $u.is_deletable}}
-                                       {{if $u.blocked}}
-                                               <a href="{{$baseurl}}/admin/users/blocked/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
-                                                       <i class="fa fa-check-circle-o" aria-hidden="true"></i>
-                                               </a>
-                                       {{/if}}
-                                               <a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
-                                                       <i class="fa fa-trash" aria-hidden="true"></i>
-                                               </a>
-                               {{else}}
-                                               &nbsp;
-                               {{/if}}
-                                       </td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="panel-footer">
-                       <button type="submit" name="page_users_unblock" value="1" class="btn btn-primary">
-                               <i class="fa fa-check-circle-o" aria-hidden="true"></i> {{$unblock}}
-                       </button>
-                       <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
-                               <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
-                       </button>
-               </div>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/theme/frio/templates/admin/users/create.tpl b/view/theme/frio/templates/admin/users/create.tpl
deleted file mode 100644 (file)
index 4b036e0..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<div id="admin-users" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}}</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               {{include file="field_input.tpl" field=$newusername}}
-               {{include file="field_input.tpl" field=$newusernickname}}
-               {{include file="field_input.tpl" field=$newuseremail}}
-               <p>
-                       <button type="submit" class="btn btn-primary">{{$submit}}</button>
-               </p>
-       </form>
-</div>
diff --git a/view/theme/frio/templates/admin/users/deleted.tpl b/view/theme/frio/templates/admin/users/deleted.tpl
deleted file mode 100644 (file)
index cc4fa5a..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
-
-<div id="admin-users" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               <table id="deleted" class="table table-hover">
-                       <thead>
-                               <tr>
-                                       <th></th>
-                                       {{foreach $th_deleted as $k=>$th}}
-                                               {{if in_array($k,[0,1,5])}}
-                                               <th>{{$th}}</th>
-                                               {{/if}}
-                                       {{/foreach}}
-                               </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr>
-                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
-                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
-                                       <td>{{$u.email}}</td>
-                                       <td>{{$u.deleted}}</td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/theme/frio/templates/admin/users/index.tpl b/view/theme/frio/templates/admin/users/index.tpl
deleted file mode 100644 (file)
index d46a41c..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
-
-<div id="admin-users" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-       <p>
-               <a href="{{$base_url}}/admin/users/create" class="btn btn-primary"><i class="fa fa-user-plus"></i> {{$h_newuser}}</a>
-       </p>
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-               <table id="users" class="table table-hover">
-                       <thead>
-                               <tr>
-                                       <th>
-                                               <div class="checkbox">
-                                                       <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
-                                                       <label for="admin-settings-users-select"></label>
-                                               </div>
-                                       </th>
-                                       <th></th>
-                                       {{foreach $th_users as $k=>$th}}
-                                               {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
-                                               <th class="th-{{$k}}">
-                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
-                                                               {{if $order_users == $th.1}}
-                                                                       {{if $order_direction_users == "+"}}
-                                                                       &#8595;
-                                                                       {{else}}
-                                                                       &#8593;
-                                                                       {{/if}}
-                                                               {{else}}
-                                                               &#8597;
-                                                               {{/if}}
-                                                               {{$th.0}}
-                                                       </a>
-                                               </th>
-                                               {{/if}}
-                                       {{/foreach}}
-                                       <th></th>
-                               </tr>
-                       </thead>
-                       <tbody>
-                       {{foreach $users as $u}}
-                               <tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
-                                       <td>
-                                               {{if $u.is_deletable}}
-                                               <div class="checkbox">
-                                                       <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
-                                                       <label for="id_user_{{$u.uid}}"></label>
-                                               </div>
-                                               {{else}}
-                                               &nbsp;
-                                               {{/if}}
-                                       </td>
-                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
-                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
-                                       <td>{{$u.email}}</td>
-                               {{if $order_users == $th_users.2.1}}
-                                       <td>{{$u.register_date}}</td>
-                               {{/if}}
-
-                               {{if $order_users == $th_users.3.1}}
-                                       <td>{{$u.login_date}}</td>
-                               {{/if}}
-
-                               {{if $order_users == $th_users.4.1}}
-                                       <td>{{$u.lastitem_date}}</td>
-                               {{/if}}
-
-                               {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
-                                       <td>
-                                               <i class="fa
-                                                       {{if $u.page_flags_raw==0}}fa-user{{/if}}               {{* PAGE_NORMAL *}}
-                                                       {{if $u.page_flags_raw==1}}fa-bullhorn{{/if}}           {{* PAGE_SOAPBOX *}}
-                                                       {{if $u.page_flags_raw==2}}fa-users{{/if}}              {{* PAGE_COMMUNITY *}}
-                                                       {{if $u.page_flags_raw==3}}fa-heart{{/if}}              {{* PAGE_FREELOVE *}}
-                                                       {{if $u.page_flags_raw==4}}fa-rss{{/if}}                {{* PAGE_BLOG *}}
-                                                       {{if $u.page_flags_raw==5}}fa-user-secret{{/if}}        {{* PAGE_PRVGROUP *}}
-                                                       " title="{{$u.page_flags}}">
-                                               </i>
-                                               {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
-                                               <i class="fa
-                                                       {{if $u.account_type_raw==1}}fa-sitemap{{/if}}          {{* ACCOUNT_TYPE_ORGANISATION *}}
-                                                       {{if $u.account_type_raw==2}}fa-newspaper-o{{/if}}      {{* ACCOUNT_TYPE_NEWS *}}
-                                                       {{if $u.account_type_raw==3}}fa-comments{{/if}}         {{* ACCOUNT_TYPE_COMMUNITY *}}
-                                                       " title="{{$u.account_type}}">
-                                               </i>
-                                               {{/if}}
-                                               {{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
-                                               {{if $u.blocked}}<i class="fa fa-ban text-danger" title="{{$blocked}}"></i>{{/if}}
-                                               {{if $u.deleted}}<i class="fa fa-user-times" title="{{$h_deleted}}"></i>{{/if}}
-                                               {{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
-                                       </td>
-                               {{/if}}
-
-                                       <td class="text-right">
-                                               <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
-                                       </td>
-                               </tr>
-                               <tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
-                                       <td>&nbsp;</td>
-                                       <td colspan="4">
-                                       {{if $order_users != $th_users.2.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
-                                                       &#8597; {{$th_users.2.0}}</a> : {{$u.register_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if $order_users != $th_users.3.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.3.0}}</a> : {{$u.login_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if $order_users != $th_users.4.1}}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.4.0}}</a> : {{$u.lastitem_date}}
-                                               </p>
-                                       {{/if}}
-
-                                       {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
-                                               <p>
-                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
-                                                               &#8597; {{$th_users.5.0}}</a> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
-                                               </p>
-                                       {{/if}}
-
-                                       </td>
-                                       <td class="text-right">
-                               {{if $u.is_deletable}}
-                                       {{if $u.blocked}}
-                                               <a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
-                                                       <i class="fa fa-check-circle-o" aria-hidden="true"></i>
-                                               </a>
-                                       {{else}}
-                                               <a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
-                                                       <i class="fa fa-ban" aria-hidden="true"></i>
-                                               </a>
-                                       {{/if}}
-                                               <a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
-                                                       <i class="fa fa-trash" aria-hidden="true"></i>
-                                               </a>
-                               {{else}}
-                                               &nbsp;
-                               {{/if}}
-                                       </td>
-                               </tr>
-                       {{/foreach}}
-                       </tbody>
-               </table>
-               <div class="panel-footer">
-                       <button type="submit" name="page_users_block" value="1" class="btn btn-warning">
-                               <i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
-                       </button>
-                       <button type="submit" name="page_users_unblock" value="1" class="btn btn-default">
-                               <i class="fa fa-check-circle-o" aria-hidden="true"></i> {{$unblock}}
-                       </button>
-                       <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
-                               <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
-                       </button>
-               </div>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/theme/frio/templates/admin/users/pending.tpl b/view/theme/frio/templates/admin/users/pending.tpl
deleted file mode 100644 (file)
index dfb8d7e..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
-<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
-
-<div id="admin-users" class="adminpage generic-page-wrapper">
-       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
-
-       <form action="{{$baseurl}}/{{$query_string}}" method="post">
-               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
-
-               <table id="pending" class="table table-hover">
-                       <thead>
-                               <tr>
-                                       <th>
-                                               <div class="checkbox">
-                                                       <input type="checkbox" id="admin-settings-pending-select" class="selecttoggle" data-select-class="pending_ckbx"/>
-                                                       <label for="admin-settings-pending-select"></label>
-                                               </div>
-                                       </th>
-                                       {{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}}
-                                       <th></th>
-                               </tr>
-                       </thead>
-                       <tbody>
-               {{foreach $pending as $u}}
-                               <tr>
-                                       <td>
-                                               <div class="checkbox">
-                                                       <input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}" />
-                                                       <label for="id_pending_{{$u.hash}}"></label>
-                                               </div>
-                                       </td>
-                                       <td>{{$u.created}}</td>
-                                       <td>{{$u.name}}</td>
-                                       <td>{{$u.email}}</td>
-                                       <td>
-                                               <a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link btn btn-sm btn-primary" title="{{$approve}}"><i class="fa fa-check" aria-hidden="true"></i></a>
-                                               <a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link btn btn-sm btn-warning" title="{{$deny}}"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
-                                       </td>
-                               </tr>
-                       {{if $u.note}}
-                               <tr class="details">
-                                       <td></td>
-                                       <th>{{$pendingnotetext}}</th>
-                                       <td colspan="4">{{$u.note}}</td>
-                               </tr>
-                       {{/if}}
-               {{/foreach}}
-                       </tbody>
-               </table>
-               <button type="submit" name="page_users_approve" value="1" class="btn btn-primary">
-                       <i class="fa fa-check" aria-hidden="true"></i> {{$approve}}
-               </button>
-               <button type="submit" name="page_users_deny" value="1" class="btn btn-warning">
-                       <i class="fa fa-trash-o" aria-hidden="true"></i> {{$deny}}
-               </button>
-               {{$pager nofilter}}
-       </form>
-</div>
diff --git a/view/theme/frio/templates/moderation/aside.tpl b/view/theme/frio/templates/moderation/aside.tpl
new file mode 100644 (file)
index 0000000..1e6ad08
--- /dev/null
@@ -0,0 +1,30 @@
+<script type="text/javascript">
+       // update pending count //
+       $(function(){
+               $("nav").bind('nav-update', function(e,data){
+                       var elm = $('#pending-update');
+                       var register = parseInt($(data).find('register').text());
+                       if (register > 0) {
+                               elm.html(register);
+                       }
+               });
+       });
+</script>
+
+{{foreach $subpages as $page}}
+<div class="widget">
+       <h3>{{$page.0}}</h3>
+       <ul role="menu">
+               {{foreach $page.1 as $item}}
+               <li role="menuitem" class="{{$item.2}}">
+                       <a href="{{$item.0}}" {{if $item.accesskey}}accesskey="{{$item.accesskey}}"{{/if}}>
+                               {{$item.1}}
+                               {{if $name == "users"}}
+                                <span id="pending-update" class="badge pull-right"></span>
+                               {{/if}}
+                       </a>
+               </li>
+               {{/foreach}}
+       </ul>
+</div>
+{{/foreach}}
diff --git a/view/theme/frio/templates/moderation/blocklist/contact.tpl b/view/theme/frio/templates/moderation/blocklist/contact.tpl
new file mode 100644 (file)
index 0000000..e6acce2
--- /dev/null
@@ -0,0 +1,109 @@
+<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
+
+<div id="admin-contactblock" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}}</h1>
+       <p>{{$description nofilter}}</p>
+
+       {{* We organize the settings in collapsable panel-groups *}}
+       <div class="panel-group panel-group-settings" id="admin-settings" role="tablist" aria-multiselectable="true">
+               {{* The form for entering user profile which should be blocked *}}
+               <div class="panel">
+                       <div class="panel-heading section-subtitle-wrapper" role="tab" id="admin-settings-contactblock-block">
+                               <h4>
+                                       <button class="btn-link accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-contactblock-block-collapse" aria-expanded="false" aria-controls="admin-settings-contactblock-block-collapse">
+                                               {{$h_newblock}}
+                                       </button>
+                               </h4>
+                       </div>
+
+                       <div id="admin-settings-contactblock-block-collapse" class="panel-body panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-contactblock-block">
+                               <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
+                                       <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+                                       {{include file="field_input.tpl" field=$contacturl}}
+                                       {{include file="field_checkbox.tpl" field=$contact_block_purge}}
+                                       {{include file="field_textarea.tpl" field=$contact_block_reason}}
+
+                                       <div class="admin-settings-submit-wrapper form-group pull-right">
+                                               <button type="submit" class="btn btn-primary" name="page_contactblock_block" value="1">{{$submit}}</button>
+                                       </div>
+                                       <div class="clear"></div>
+                               </form>
+                       </div>
+               </div>
+
+               {{* The list of blocked user profiles with the possibility to unblock them *}}
+               <div class="panel">
+                       <div class="panel-heading section-subtitle-wrapper" role="tab" id="admin-settings-contactblock-blocked">
+                               <h4>
+                                       <button class="btn-link accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-contactblock-blocked-collapse" aria-expanded="{{if count($contacts) > 0}}true{{else}}false{{/if}}" aria-controls="admin-settings-contactblock-blocked-collapse">
+                                               {{$h_contacts}} ({{$total_contacts}})
+                                       </button>
+                               </h4>
+                       </div>
+
+                       <div id="admin-settings-contactblock-blocked-collapse" class="panel-body panel-collapse collapse {{if count($contacts) > 0}}in{{/if}}" role="tabpanel" aria-labelledby="admin-settings-contactblock-blocked">
+                               <form action="{{$baseurl}}/admin/blocklist/contact" method="post">
+                                       <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+                                       {{if $contacts}}
+                                       <table id="contactblock" class="table table-condensed table-striped">
+                                               <thead>
+                                                       <tr>
+                                                               <th></th>
+                                                               {{foreach $th_contacts as $th}}
+                                                                       <th>
+                                                                               {{$th}}
+                                                                       </th>
+                                                               {{/foreach}}
+                                                       </tr>
+                                               </thead>
+                                               <tbody>
+                                                       {{foreach $contacts as $contact}}
+                                                               <tr>
+                                                                       <td>
+                                                                               <div class="checkbox">
+                                                                                       <input type="checkbox" class="contacts_ckbx" id="id_contact_{{$contact.id}}" name="contacts[]" value="{{$contact.id}}"/>
+                                                                                       <label for="id_contact_{{$contact.id}}"></label>
+                                                                               </div>
+                                                                       </td>
+                                                                       <td><img class="icon" src="{{$contact.micro}}" alt="{{$contact.nickname}}" title="{{$contact.addr}}"></td>
+                                                                       <td class="name">
+                                                                               {{$contact.name}}<br>
+                                                                               <a href="{{$contact.url}}" title="{{$contact.nickname}}">{{$contact.addr}}</a>
+                                                                       </td>
+                                                                       <td class="reason">{{if $contact.block_reason}}{{$contact.block_reason}}{{else}}N/A{{/if}}</td>
+                                                               </tr>
+                                                       {{/foreach}}
+                                               </tbody>
+                                               <tfoot>
+                                                       <tr>
+                                                               <td>
+                                                                       {{* Checkbox to select all blocked contacts *}}
+                                                                       <div class="checkbox">
+                                                                               <input type="checkbox" id="contactblock-select" class="selecttoggle contacts_ckbx" data-select-class="contacts_ckbx" data-select-all="{{$select_all}}" data-select-none="{{$select_none}}" title="{{$select_all}}"/>
+                                                                               <label for="contactblock-select"></label>
+                                                                       </div>
+                                                               </td>
+                                                               <td colspan="3">
+                                                                       {{$total_contacts}}
+                                                                       <div class="admin-settings-submit-wrapper form-group pull-right">
+                                                                               <button type="submit" class="btn btn-small btn-default pull-right" name="page_contactblock_unblock" value="1">{{$unblock}}</button>
+                                                                       </div>
+                                                                       <div class="clear"></div>
+                                                               </td>
+                                                       </tr>
+                                               </tfoot>
+                                       </table>
+
+                                       {{$paginate nofilter}}
+
+                                       {{else}}
+                                       <p>{{$no_data}}</p>
+                                       {{/if}}
+                               </form>
+                       </div>
+               </div>
+       </div>
+</div>
diff --git a/view/theme/frio/templates/moderation/summary.tpl b/view/theme/frio/templates/moderation/summary.tpl
new file mode 100644 (file)
index 0000000..71c4ad5
--- /dev/null
@@ -0,0 +1,33 @@
+
+<div id='adminpage-summery' class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}}</h1>
+
+       <div id="admin-summary-wrapper">
+               {{* Number of pending registrations. *}}
+               <div id="admin-summary-pending" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
+                       <hr class="admin-summary-separator">
+                       <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$pending.0}}</div>
+                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">{{$pending.1}}</div>
+               </div>
+
+               {{* Number of registered users *}}
+               <div id="admin-summary-users" class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
+                       <hr class="admin-summary-separator">
+                       <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$users.0}}</div>
+                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">{{$users.1}}</div>
+               </div>
+
+               {{* Account types of registered users. *}}
+               {{foreach $accounts as $p}}
+               <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 admin-summary">
+                       <hr class="admin-summary-separator">
+                       <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 admin-summary-label-name text-muted">{{$p.0}}</div>
+                       <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 admin-summary-entry">{{if $p.1}}{{$p.1}}{{else}}0{{/if}}</div>
+               </div>
+               {{/foreach}}
+
+       </div>
+
+       <div class="clear"></div>
+
+</div>
diff --git a/view/theme/frio/templates/moderation/users/active.tpl b/view/theme/frio/templates/moderation/users/active.tpl
new file mode 100644 (file)
index 0000000..7d5ef4d
--- /dev/null
@@ -0,0 +1,156 @@
+<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
+
+<div id="admin-users" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+       <p>
+               <a href="{{$base_url}}/admin/users/create" class="btn btn-primary"><i class="fa fa-user-plus"></i> {{$h_newuser}}</a>
+       </p>
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               <table id="users" class="table table-hover">
+                       <thead>
+                               <tr>
+                                       <th>
+                                               <div class="checkbox">
+                                                       <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
+                                                       <label for="admin-settings-users-select"></label>
+                                               </div>
+                                       </th>
+                                       <th></th>
+                                       {{foreach $th_users as $k=>$th}}
+                                               {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
+                                               <th class="th-{{$k}}">
+                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
+                                                               {{if $order_users == $th.1}}
+                                                                       {{if $order_direction_users == "+"}}
+                                                                       &#8595;
+                                                                       {{else}}
+                                                                       &#8593;
+                                                                       {{/if}}
+                                                               {{else}}
+                                                               &#8597;
+                                                               {{/if}}
+                                                               {{$th.0}}
+                                                       </a>
+                                               </th>
+                                               {{/if}}
+                                       {{/foreach}}
+                                       <th></th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
+                                       <td>
+                                               {{if $u.is_deletable}}
+                                               <div class="checkbox">
+                                                       <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
+                                                       <label for="id_user_{{$u.uid}}"></label>
+                                               </div>
+                                               {{else}}
+                                               &nbsp;
+                                               {{/if}}
+                                       </td>
+                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
+                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
+                                       <td>{{$u.email}}</td>
+                               {{if $order_users == $th_users.2.1}}
+                                       <td>{{$u.register_date}}</td>
+                               {{/if}}
+
+                               {{if $order_users == $th_users.3.1}}
+                                       <td>{{$u.login_date}}</td>
+                               {{/if}}
+
+                               {{if $order_users == $th_users.4.1}}
+                                       <td>{{$u.lastitem_date}}</td>
+                               {{/if}}
+
+                               {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+                                       <td>
+                                               <i class="fa
+                                                       {{if $u.page_flags_raw==0}}fa-user{{/if}}               {{* PAGE_NORMAL *}}
+                                                       {{if $u.page_flags_raw==1}}fa-bullhorn{{/if}}           {{* PAGE_SOAPBOX *}}
+                                                       {{if $u.page_flags_raw==2}}fa-users{{/if}}              {{* PAGE_COMMUNITY *}}
+                                                       {{if $u.page_flags_raw==3}}fa-heart{{/if}}              {{* PAGE_FREELOVE *}}
+                                                       {{if $u.page_flags_raw==4}}fa-rss{{/if}}                {{* PAGE_BLOG *}}
+                                                       {{if $u.page_flags_raw==5}}fa-user-secret{{/if}}        {{* PAGE_PRVGROUP *}}
+                                                       " title="{{$u.page_flags}}">
+                                               </i>
+                                               {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
+                                               <i class="fa
+                                                       {{if $u.account_type_raw==1}}fa-sitemap{{/if}}          {{* ACCOUNT_TYPE_ORGANISATION *}}
+                                                       {{if $u.account_type_raw==2}}fa-newspaper-o{{/if}}      {{* ACCOUNT_TYPE_NEWS *}}
+                                                       {{if $u.account_type_raw==3}}fa-comments{{/if}}         {{* ACCOUNT_TYPE_COMMUNITY *}}
+                                                       " title="{{$u.account_type}}">
+                                               </i>
+                                               {{/if}}
+                                               {{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
+                                               {{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
+                                       </td>
+                               {{/if}}
+
+                                       <td class="text-right">
+                                               <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
+                                       </td>
+                               </tr>
+                               <tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
+                                       <td>&nbsp;</td>
+                                       <td colspan="4">
+                                       {{if $order_users != $th_users.2.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
+                                                       &#8597; {{$th_users.2.0}}</a> : {{$u.register_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if $order_users != $th_users.3.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.3.0}}</a> : {{$u.login_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if $order_users != $th_users.4.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.4.0}}</a> : {{$u.lastitem_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.5.0}}</a> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
+                                               </p>
+                                       {{/if}}
+
+                                       </td>
+                                       <td class="text-right">
+                               {{if $u.is_deletable}}
+                                               <a href="{{$baseurl}}/admin/users/active/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
+                                                       <i class="fa fa-ban" aria-hidden="true"></i>
+                                               </a>
+                                               <a href="{{$baseurl}}/admin/users/active/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
+                                                       <i class="fa fa-trash" aria-hidden="true"></i>
+                                               </a>
+                               {{else}}
+                                               &nbsp;
+                               {{/if}}
+                                       </td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="panel-footer">
+                       <button type="submit" name="page_users_block" value="1" class="btn btn-warning">
+                               <i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
+                       </button>
+                       <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
+                               <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
+                       </button>
+               </div>
+               {{$pager nofilter}}
+       </form>
+</div>
diff --git a/view/theme/frio/templates/moderation/users/blocked.tpl b/view/theme/frio/templates/moderation/users/blocked.tpl
new file mode 100644 (file)
index 0000000..1e77c9a
--- /dev/null
@@ -0,0 +1,158 @@
+<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
+
+<div id="admin-users-blocked" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               <table id="users" class="table table-hover">
+                       <thead>
+                               <tr>
+                                       <th>
+                                               <div class="checkbox">
+                                                       <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
+                                                       <label for="admin-settings-users-select"></label>
+                                               </div>
+                                       </th>
+                                       <th></th>
+                                       {{foreach $th_users as $k=>$th}}
+                                               {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
+                                               <th class="th-{{$k}}">
+                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
+                                                               {{if $order_users == $th.1}}
+                                                                       {{if $order_direction_users == "+"}}
+                                                                       &#8595;
+                                                                       {{else}}
+                                                                       &#8593;
+                                                                       {{/if}}
+                                                               {{else}}
+                                                               &#8597;
+                                                               {{/if}}
+                                                               {{$th.0}}
+                                                       </a>
+                                               </th>
+                                               {{/if}}
+                                       {{/foreach}}
+                                       <th></th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
+                                       <td>
+                                               {{if $u.is_deletable}}
+                                               <div class="checkbox">
+                                                       <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
+                                                       <label for="id_user_{{$u.uid}}"></label>
+                                               </div>
+                                               {{else}}
+                                               &nbsp;
+                                               {{/if}}
+                                       </td>
+                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
+                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
+                                       <td>{{$u.email}}</td>
+                               {{if $order_users == $th_users.2.1}}
+                                       <td>{{$u.register_date}}</td>
+                               {{/if}}
+
+                               {{if $order_users == $th_users.3.1}}
+                                       <td>{{$u.login_date}}</td>
+                               {{/if}}
+
+                               {{if $order_users == $th_users.4.1}}
+                                       <td>{{$u.lastitem_date}}</td>
+                               {{/if}}
+
+                               {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+                                       <td>
+                                               <i class="fa
+                                                       {{if $u.page_flags_raw==0}}fa-user{{/if}}               {{* PAGE_NORMAL *}}
+                                                       {{if $u.page_flags_raw==1}}fa-bullhorn{{/if}}           {{* PAGE_SOAPBOX *}}
+                                                       {{if $u.page_flags_raw==2}}fa-users{{/if}}              {{* PAGE_COMMUNITY *}}
+                                                       {{if $u.page_flags_raw==3}}fa-heart{{/if}}              {{* PAGE_FREELOVE *}}
+                                                       {{if $u.page_flags_raw==4}}fa-rss{{/if}}                {{* PAGE_BLOG *}}
+                                                       {{if $u.page_flags_raw==5}}fa-user-secret{{/if}}        {{* PAGE_PRVGROUP *}}
+                                                       " title="{{$u.page_flags}}">
+                                               </i>
+                                               {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
+                                               <i class="fa
+                                                       {{if $u.account_type_raw==1}}fa-sitemap{{/if}}          {{* ACCOUNT_TYPE_ORGANISATION *}}
+                                                       {{if $u.account_type_raw==2}}fa-newspaper-o{{/if}}      {{* ACCOUNT_TYPE_NEWS *}}
+                                                       {{if $u.account_type_raw==3}}fa-comments{{/if}}         {{* ACCOUNT_TYPE_COMMUNITY *}}
+                                                       " title="{{$u.account_type}}">
+                                               </i>
+                                               {{/if}}
+                                               {{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
+                                               {{if $u.blocked}}<i class="fa fa-ban text-danger" title="{{$blocked}}"></i>{{/if}}
+                                               {{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
+                                       </td>
+                               {{/if}}
+
+                                       <td class="text-right">
+                                               <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
+                                       </td>
+                               </tr>
+                               <tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
+                                       <td>&nbsp;</td>
+                                       <td colspan="4">
+                                       {{if $order_users != $th_users.2.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
+                                                       &#8597; {{$th_users.2.0}}</a> : {{$u.register_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if $order_users != $th_users.3.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.3.0}}</a> : {{$u.login_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if $order_users != $th_users.4.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.4.0}}</a> : {{$u.lastitem_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.5.0}}</a> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
+                                               </p>
+                                       {{/if}}
+
+                                       </td>
+                                       <td class="text-right">
+                               {{if $u.is_deletable}}
+                                       {{if $u.blocked}}
+                                               <a href="{{$baseurl}}/admin/users/blocked/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
+                                                       <i class="fa fa-check-circle-o" aria-hidden="true"></i>
+                                               </a>
+                                       {{/if}}
+                                               <a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
+                                                       <i class="fa fa-trash" aria-hidden="true"></i>
+                                               </a>
+                               {{else}}
+                                               &nbsp;
+                               {{/if}}
+                                       </td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="panel-footer">
+                       <button type="submit" name="page_users_unblock" value="1" class="btn btn-primary">
+                               <i class="fa fa-check-circle-o" aria-hidden="true"></i> {{$unblock}}
+                       </button>
+                       <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
+                               <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
+                       </button>
+               </div>
+               {{$pager nofilter}}
+       </form>
+</div>
diff --git a/view/theme/frio/templates/moderation/users/create.tpl b/view/theme/frio/templates/moderation/users/create.tpl
new file mode 100644 (file)
index 0000000..4b036e0
--- /dev/null
@@ -0,0 +1,14 @@
+<div id="admin-users" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}}</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               {{include file="field_input.tpl" field=$newusername}}
+               {{include file="field_input.tpl" field=$newusernickname}}
+               {{include file="field_input.tpl" field=$newuseremail}}
+               <p>
+                       <button type="submit" class="btn btn-primary">{{$submit}}</button>
+               </p>
+       </form>
+</div>
diff --git a/view/theme/frio/templates/moderation/users/deleted.tpl b/view/theme/frio/templates/moderation/users/deleted.tpl
new file mode 100644 (file)
index 0000000..cc4fa5a
--- /dev/null
@@ -0,0 +1,34 @@
+<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
+
+<div id="admin-users" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               <table id="deleted" class="table table-hover">
+                       <thead>
+                               <tr>
+                                       <th></th>
+                                       {{foreach $th_deleted as $k=>$th}}
+                                               {{if in_array($k,[0,1,5])}}
+                                               <th>{{$th}}</th>
+                                               {{/if}}
+                                       {{/foreach}}
+                               </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr>
+                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
+                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
+                                       <td>{{$u.email}}</td>
+                                       <td>{{$u.deleted}}</td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               {{$pager nofilter}}
+       </form>
+</div>
diff --git a/view/theme/frio/templates/moderation/users/index.tpl b/view/theme/frio/templates/moderation/users/index.tpl
new file mode 100644 (file)
index 0000000..d46a41c
--- /dev/null
@@ -0,0 +1,167 @@
+<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
+
+<div id="admin-users" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+       <p>
+               <a href="{{$base_url}}/admin/users/create" class="btn btn-primary"><i class="fa fa-user-plus"></i> {{$h_newuser}}</a>
+       </p>
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+               <table id="users" class="table table-hover">
+                       <thead>
+                               <tr>
+                                       <th>
+                                               <div class="checkbox">
+                                                       <input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
+                                                       <label for="admin-settings-users-select"></label>
+                                               </div>
+                                       </th>
+                                       <th></th>
+                                       {{foreach $th_users as $k=>$th}}
+                                               {{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
+                                               <th class="th-{{$k}}">
+                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
+                                                               {{if $order_users == $th.1}}
+                                                                       {{if $order_direction_users == "+"}}
+                                                                       &#8595;
+                                                                       {{else}}
+                                                                       &#8593;
+                                                                       {{/if}}
+                                                               {{else}}
+                                                               &#8597;
+                                                               {{/if}}
+                                                               {{$th.0}}
+                                                       </a>
+                                               </th>
+                                               {{/if}}
+                                       {{/foreach}}
+                                       <th></th>
+                               </tr>
+                       </thead>
+                       <tbody>
+                       {{foreach $users as $u}}
+                               <tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
+                                       <td>
+                                               {{if $u.is_deletable}}
+                                               <div class="checkbox">
+                                                       <input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
+                                                       <label for="id_user_{{$u.uid}}"></label>
+                                               </div>
+                                               {{else}}
+                                               &nbsp;
+                                               {{/if}}
+                                       </td>
+                                       <td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
+                                       <td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
+                                       <td>{{$u.email}}</td>
+                               {{if $order_users == $th_users.2.1}}
+                                       <td>{{$u.register_date}}</td>
+                               {{/if}}
+
+                               {{if $order_users == $th_users.3.1}}
+                                       <td>{{$u.login_date}}</td>
+                               {{/if}}
+
+                               {{if $order_users == $th_users.4.1}}
+                                       <td>{{$u.lastitem_date}}</td>
+                               {{/if}}
+
+                               {{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+                                       <td>
+                                               <i class="fa
+                                                       {{if $u.page_flags_raw==0}}fa-user{{/if}}               {{* PAGE_NORMAL *}}
+                                                       {{if $u.page_flags_raw==1}}fa-bullhorn{{/if}}           {{* PAGE_SOAPBOX *}}
+                                                       {{if $u.page_flags_raw==2}}fa-users{{/if}}              {{* PAGE_COMMUNITY *}}
+                                                       {{if $u.page_flags_raw==3}}fa-heart{{/if}}              {{* PAGE_FREELOVE *}}
+                                                       {{if $u.page_flags_raw==4}}fa-rss{{/if}}                {{* PAGE_BLOG *}}
+                                                       {{if $u.page_flags_raw==5}}fa-user-secret{{/if}}        {{* PAGE_PRVGROUP *}}
+                                                       " title="{{$u.page_flags}}">
+                                               </i>
+                                               {{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
+                                               <i class="fa
+                                                       {{if $u.account_type_raw==1}}fa-sitemap{{/if}}          {{* ACCOUNT_TYPE_ORGANISATION *}}
+                                                       {{if $u.account_type_raw==2}}fa-newspaper-o{{/if}}      {{* ACCOUNT_TYPE_NEWS *}}
+                                                       {{if $u.account_type_raw==3}}fa-comments{{/if}}         {{* ACCOUNT_TYPE_COMMUNITY *}}
+                                                       " title="{{$u.account_type}}">
+                                               </i>
+                                               {{/if}}
+                                               {{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
+                                               {{if $u.blocked}}<i class="fa fa-ban text-danger" title="{{$blocked}}"></i>{{/if}}
+                                               {{if $u.deleted}}<i class="fa fa-user-times" title="{{$h_deleted}}"></i>{{/if}}
+                                               {{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
+                                       </td>
+                               {{/if}}
+
+                                       <td class="text-right">
+                                               <button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
+                                       </td>
+                               </tr>
+                               <tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
+                                       <td>&nbsp;</td>
+                                       <td colspan="4">
+                                       {{if $order_users != $th_users.2.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
+                                                       &#8597; {{$th_users.2.0}}</a> : {{$u.register_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if $order_users != $th_users.3.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.3.0}}</a> : {{$u.login_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if $order_users != $th_users.4.1}}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.4.0}}</a> : {{$u.lastitem_date}}
+                                               </p>
+                                       {{/if}}
+
+                                       {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
+                                               <p>
+                                                       <a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
+                                                               &#8597; {{$th_users.5.0}}</a> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
+                                               </p>
+                                       {{/if}}
+
+                                       </td>
+                                       <td class="text-right">
+                               {{if $u.is_deletable}}
+                                       {{if $u.blocked}}
+                                               <a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
+                                                       <i class="fa fa-check-circle-o" aria-hidden="true"></i>
+                                               </a>
+                                       {{else}}
+                                               <a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
+                                                       <i class="fa fa-ban" aria-hidden="true"></i>
+                                               </a>
+                                       {{/if}}
+                                               <a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
+                                                       <i class="fa fa-trash" aria-hidden="true"></i>
+                                               </a>
+                               {{else}}
+                                               &nbsp;
+                               {{/if}}
+                                       </td>
+                               </tr>
+                       {{/foreach}}
+                       </tbody>
+               </table>
+               <div class="panel-footer">
+                       <button type="submit" name="page_users_block" value="1" class="btn btn-warning">
+                               <i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
+                       </button>
+                       <button type="submit" name="page_users_unblock" value="1" class="btn btn-default">
+                               <i class="fa fa-check-circle-o" aria-hidden="true"></i> {{$unblock}}
+                       </button>
+                       <button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
+                               <i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
+                       </button>
+               </div>
+               {{$pager nofilter}}
+       </form>
+</div>
diff --git a/view/theme/frio/templates/moderation/users/pending.tpl b/view/theme/frio/templates/moderation/users/pending.tpl
new file mode 100644 (file)
index 0000000..dfb8d7e
--- /dev/null
@@ -0,0 +1,58 @@
+<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
+<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
+
+<div id="admin-users" class="adminpage generic-page-wrapper">
+       <h1>{{$title}} - {{$page}} ({{$count}})</h1>
+
+       <form action="{{$baseurl}}/{{$query_string}}" method="post">
+               <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
+
+               <table id="pending" class="table table-hover">
+                       <thead>
+                               <tr>
+                                       <th>
+                                               <div class="checkbox">
+                                                       <input type="checkbox" id="admin-settings-pending-select" class="selecttoggle" data-select-class="pending_ckbx"/>
+                                                       <label for="admin-settings-pending-select"></label>
+                                               </div>
+                                       </th>
+                                       {{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}}
+                                       <th></th>
+                               </tr>
+                       </thead>
+                       <tbody>
+               {{foreach $pending as $u}}
+                               <tr>
+                                       <td>
+                                               <div class="checkbox">
+                                                       <input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}" />
+                                                       <label for="id_pending_{{$u.hash}}"></label>
+                                               </div>
+                                       </td>
+                                       <td>{{$u.created}}</td>
+                                       <td>{{$u.name}}</td>
+                                       <td>{{$u.email}}</td>
+                                       <td>
+                                               <a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link btn btn-sm btn-primary" title="{{$approve}}"><i class="fa fa-check" aria-hidden="true"></i></a>
+                                               <a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link btn btn-sm btn-warning" title="{{$deny}}"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
+                                       </td>
+                               </tr>
+                       {{if $u.note}}
+                               <tr class="details">
+                                       <td></td>
+                                       <th>{{$pendingnotetext}}</th>
+                                       <td colspan="4">{{$u.note}}</td>
+                               </tr>
+                       {{/if}}
+               {{/foreach}}
+                       </tbody>
+               </table>
+               <button type="submit" name="page_users_approve" value="1" class="btn btn-primary">
+                       <i class="fa fa-check" aria-hidden="true"></i> {{$approve}}
+               </button>
+               <button type="submit" name="page_users_deny" value="1" class="btn btn-warning">
+                       <i class="fa fa-trash-o" aria-hidden="true"></i> {{$deny}}
+               </button>
+               {{$pager nofilter}}
+       </form>
+</div>
index dd71acff299754fc411d38b77b5e9e5ebcfa30f4..ec8d54bccbd8af530c5f311a02db0c8948d0aa6f 100644 (file)
                                                                                        </a>
                                                                                </li>
                                                                        {{/if}}
+                                                                       {{if $nav.moderation}}
+                                                                               <li role="presentation">
+                                                                                       <a accesskey="m" role="menuitem" id="nav-moderation-link"
+                                                                                               class="nav-link {{$nav.moderation.2}}" href="{{$nav.moderation.0}}"
+                                                                                               title="{{$nav.moderation.3}}"><i class="fa fa-user-secret fa-fw" aria-hidden="true"></i>
+                                                                                               {{$nav.moderation.1}}
+                                                                                       </a>
+                                                                               </li>
+                                                                       {{/if}}
                                                                        {{if $nav.tos}}
                                                                                <li role="presentation" class="divider"></li>
                                                                                <li role="presentation">
index 5ad091408e26d8446506c22859828c234497d16f..6bd59b5240612ec401c8bca0c5642d7322d2a116 100644 (file)
@@ -75,6 +75,7 @@
 
                                {{if $nav.settings}}<li><a class="{{$nav.settings.2}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}">{{$nav.settings.1}}</a></li>{{/if}}
                                {{if $nav.admin}}<li><a accesskey="a" class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a></li>{{/if}}
+                               {{if $nav.moderation}}<li><a accesskey="m" class="{{$nav.moderation.2}}" href="{{$nav.moderation.0}}" title="{{$nav.moderation.3}}">{{$nav.moderation.1}}</a></li>{{/if}}
 
                                {{if $nav.logout}}<li><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a></li>{{/if}}
                                {{if $nav.login}}<li><a class="{{$nav.login.2}}" href="{{$nav.login.0}}" title="{{$nav.login.3}}">{{$nav.login.1}}</a><li>{{/if}}
index aff22a79ef93f6dd479b4ce44f9456fd41b15d28..8df8136f160d74994ec40f8fdab5a2d0a44a4eb0 100644 (file)
@@ -48,6 +48,7 @@
                        {{if $nav.delegation}}<li><a id="nav-delegation-link" class="nav-commlink {{$nav.delegation.2}}" href="{{$nav.delegation.0}}">{{$nav.delegation.1}}</a></li>{{/if}}
                
                        {{if $nav.admin}}<li><a id="nav-admin-link" class="nav-commlink {{$nav.admin.2}}" href="{{$nav.admin.0}}">{{$nav.admin.1}}</a></li>{{/if}}
+                       {{if $nav.moderation}}<li><a id="nav-moderation-link" class="nav-commlink {{$nav.moderation.2}}" href="{{$nav.moderation.0}}">{{$nav.moderation.1}}</a></li>{{/if}}
                        
                        {{if $nav.help}}<li><a id="nav-help-link" class="nav-link {{$nav.help.2}}" href="{{$nav.help.0}}">{{$nav.help.1}}</a></li>{{/if}}
                        {{if $nav.tos}}<li><a id="nav-tos-link" class="nav-link {{$nav.tos.2}}" href="{{$nav.tos.0}}">{{$nav.tos.1}}</a></li>{{/if}}
index e102b305942adc374e9e8c320e5c2e630b916335..bf4a7efe9bdc761f3bf1ce7d51835f57ed92c494 100644 (file)
                                                <a accesskey="a" class="{{$nav.admin.2}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}">{{$nav.admin.1}}</a>
                                        </li>
                                        {{/if}}
-                                       {{if $nav.logout}}<li role="menuitem"><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a></li>{{/if}}
+                                       {{if $nav.moderation}}
+                                               <li role="menuitem">
+                                                       <a accesskey="m" class="{{$nav.moderation.2}}" href="{{$nav.moderation.0}}" title="{{$nav.moderation.3}}">{{$nav.moderation.1}}</a>
+                                               </li>
+                                               {{/if}}
+                                               {{if $nav.logout}}<li role="menuitem"><a class="menu-sep {{$nav.logout.2}}" href="{{$nav.logout.0}}" title="{{$nav.logout.3}}">{{$nav.logout.1}}</a></li>{{/if}}
                                </ul>
                        </li>
                {{/if}}