From 0a20566199324fd31f8f089a3e3213d2b90c045e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 8 Nov 2022 04:26:11 -0500 Subject: [PATCH] Replace remaining occurrences of admin/users route by moderation/users --- src/Module/Moderation/Users/Create.php | 8 ++++---- src/Module/Moderation/Users/Pending.php | 16 ++++++++-------- src/Module/Notifications/Ping.php | 4 ++-- src/Module/Register.php | 4 ++-- view/templates/moderation/users/active.tpl | 8 ++++---- view/templates/moderation/users/blocked.tpl | 6 +++--- view/templates/moderation/users/index.tpl | 8 ++++---- view/templates/moderation/users/pending.tpl | 4 ++-- .../frio/templates/moderation/users/active.tpl | 16 ++++++++-------- .../templates/moderation/users/blocked.tpl | 14 +++++++------- .../frio/templates/moderation/users/index.tpl | 18 +++++++++--------- .../templates/moderation/users/pending.tpl | 4 ++-- .../quattro/templates/admin/users/active.tpl | 6 +++--- .../quattro/templates/admin/users/blocked.tpl | 6 +++--- .../quattro/templates/admin/users/index.tpl | 8 ++++---- .../quattro/templates/admin/users/pending.tpl | 4 ++-- 16 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/Module/Moderation/Users/Create.php b/src/Module/Moderation/Users/Create.php index a017cf681e..e4b802baff 100644 --- a/src/Module/Moderation/Users/Create.php +++ b/src/Module/Moderation/Users/Create.php @@ -32,7 +32,7 @@ class Create extends BaseUsers { $this->checkModerationAccess(); - self::checkFormSecurityTokenRedirectOnError('/admin/users/create', 'admin_users_create'); + self::checkFormSecurityTokenRedirectOnError('moderation/users/create', 'admin_users_create'); $nu_name = $request['new_user_name'] ?? ''; $nu_nickname = $request['new_user_nickname'] ?? ''; @@ -42,20 +42,20 @@ class Create extends BaseUsers if ($nu_name !== '' && $nu_email !== '' && $nu_nickname !== '') { try { User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language); - $this->baseUrl->redirect('admin/users'); + $this->baseUrl->redirect('moderation/users'); } catch (\Exception $ex) { $this->systemMessages->addNotice($ex->getMessage()); } } - $this->baseUrl->redirect('admin/users/create'); + $this->baseUrl->redirect('moderation/users/create'); } protected function content(array $request = []): string { parent::content(); - $t = Renderer::getMarkupTemplate('admin/users/create.tpl'); + $t = Renderer::getMarkupTemplate('moderation/users/create.tpl'); return self::getTabsHTML('all') . Renderer::replaceMacros($t, [ // strings // '$title' => $this->t('Administration'), diff --git a/src/Module/Moderation/Users/Pending.php b/src/Module/Moderation/Users/Pending.php index 569d0404c7..465f6fbfa1 100644 --- a/src/Module/Moderation/Users/Pending.php +++ b/src/Module/Moderation/Users/Pending.php @@ -33,7 +33,7 @@ class Pending extends BaseUsers { $this->checkModerationAccess(); - self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending'); + self::checkFormSecurityTokenRedirectOnError('moderation/users/pending', 'admin_users_pending'); $pending = $request['pending'] ?? []; @@ -51,7 +51,7 @@ class Pending extends BaseUsers $this->systemMessages->addInfo($this->tt('%s registration revoked', '%s registrations revoked', count($pending))); } - $this->baseUrl->redirect('admin/users/pending'); + $this->baseUrl->redirect('moderation/users/pending'); } protected function content(array $request = []): string @@ -65,22 +65,22 @@ class Pending extends BaseUsers $user = User::getById($uid, ['username', 'blocked']); if (!$user) { $this->systemMessages->addNotice($this->t('User not found')); - $this->baseUrl->redirect('admin/users'); + $this->baseUrl->redirect('moderation/users'); } } switch ($action) { case 'allow': - self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't'); + self::checkFormSecurityTokenRedirectOnError('moderation/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'); + $this->baseUrl->redirect('moderation/users/pending'); break; case 'deny': - self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't'); + self::checkFormSecurityTokenRedirectOnError('moderation/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'); + $this->baseUrl->redirect('moderation/users/pending'); break; } @@ -90,7 +90,7 @@ class Pending extends BaseUsers $count = Register::getPendingCount(); - $t = Renderer::getMarkupTemplate('admin/users/pending.tpl'); + $t = Renderer::getMarkupTemplate('moderation/users/pending.tpl'); return self::getTabsHTML('pending') . Renderer::replaceMacros($t, [ // strings // '$title' => $this->t('Administration'), diff --git a/src/Module/Notifications/Ping.php b/src/Module/Notifications/Ping.php index e80d3b8ee0..2eaa2c4a5c 100644 --- a/src/Module/Notifications/Ping.php +++ b/src/Module/Notifications/Ping.php @@ -241,7 +241,7 @@ class Ping extends BaseModule ], $this->l10n->t('{0} requested registration'), new \DateTime($reg['created'], new \DateTimeZone('UTC')), - new Uri($this->baseUrl->get(true) . '/admin/users/pending') + new Uri($this->baseUrl->get(true) . '/moderation/users/pending') ); } } elseif (count($registrations) > 1) { @@ -252,7 +252,7 @@ class Ping extends BaseModule ], $this->l10n->t('{0} and %d others requested registration', count($registrations) - 1), new \DateTime($registrations[0]['created'], new \DateTimeZone('UTC')), - new Uri($this->baseUrl->get(true) . '/admin/users/pending') + new Uri($this->baseUrl->get(true) . '/moderation/users/pending') ); } diff --git a/src/Module/Register.php b/src/Module/Register.php index c168c517ef..ad3e1feeac 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -406,11 +406,11 @@ class Register extends BaseModule 'type' => Model\Notification\Type::SYSTEM, 'event' => $event, 'uid' => $admin['uid'], - 'link' => DI::baseUrl()->get(true) . '/admin/users/', + 'link' => DI::baseUrl()->get(true) . '/moderation/users/', 'source_name' => $user['username'], 'source_mail' => $user['email'], 'source_nick' => $user['nickname'], - 'source_link' => DI::baseUrl()->get(true) . '/admin/users/', + 'source_link' => DI::baseUrl()->get(true) . '/moderation/users/', 'source_photo' => User::getAvatarUrl($user, Proxy::SIZE_THUMB), 'show_in_notification_page' => false ]); diff --git a/view/templates/moderation/users/active.tpl b/view/templates/moderation/users/active.tpl index 8ec13e1fea..482cecaf89 100644 --- a/view/templates/moderation/users/active.tpl +++ b/view/templates/moderation/users/active.tpl @@ -23,7 +23,7 @@ {{foreach $th_users as $th}} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -61,10 +61,10 @@ {{if $u.is_deletable}} - + - + {{else}} @@ -83,6 +83,6 @@ {{$pager nofilter}}

- {{$h_newuser}} + {{$h_newuser}}

diff --git a/view/templates/moderation/users/blocked.tpl b/view/templates/moderation/users/blocked.tpl index 6defaf62f0..e62ea3a2dd 100644 --- a/view/templates/moderation/users/blocked.tpl +++ b/view/templates/moderation/users/blocked.tpl @@ -24,7 +24,7 @@ {{foreach $th_users as $th}} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -62,10 +62,10 @@ {{if $u.is_deletable}} - + - + {{else}} diff --git a/view/templates/moderation/users/index.tpl b/view/templates/moderation/users/index.tpl index 091940ccc1..6b3ac0d740 100644 --- a/view/templates/moderation/users/index.tpl +++ b/view/templates/moderation/users/index.tpl @@ -23,7 +23,7 @@ {{foreach $th_users as $th}} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -61,10 +61,10 @@ {{if $u.is_deletable}} - + - + {{else}} @@ -84,6 +84,6 @@ {{$pager nofilter}}

- {{$h_newuser}} + {{$h_newuser}}

diff --git a/view/templates/moderation/users/pending.tpl b/view/templates/moderation/users/pending.tpl index 43d1e5248b..68a97b8b18 100644 --- a/view/templates/moderation/users/pending.tpl +++ b/view/templates/moderation/users/pending.tpl @@ -38,10 +38,10 @@ - + - + diff --git a/view/theme/frio/templates/moderation/users/active.tpl b/view/theme/frio/templates/moderation/users/active.tpl index 7d5ef4dca4..1972f138ff 100644 --- a/view/theme/frio/templates/moderation/users/active.tpl +++ b/view/theme/frio/templates/moderation/users/active.tpl @@ -4,7 +4,7 @@

{{$title}} - {{$page}} ({{$count}})

- {{$h_newuser}} + {{$h_newuser}}

@@ -21,7 +21,7 @@ {{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])) }} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -100,28 +100,28 @@ {{if $order_users != $th_users.2.1}}

- + ↕ {{$th_users.2.0}} : {{$u.register_date}}

{{/if}} {{if $order_users != $th_users.3.1}}

- + ↕ {{$th_users.3.0}} : {{$u.login_date}}

{{/if}} {{if $order_users != $th_users.4.1}}

- + ↕ {{$th_users.4.0}} : {{$u.lastitem_date}}

{{/if}} {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}

- + ↕ {{$th_users.5.0}} : {{$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}}

{{/if}} @@ -129,10 +129,10 @@ {{if $u.is_deletable}} - + - + {{else}} diff --git a/view/theme/frio/templates/moderation/users/blocked.tpl b/view/theme/frio/templates/moderation/users/blocked.tpl index 1e77c9aaa9..3bfcced681 100644 --- a/view/theme/frio/templates/moderation/users/blocked.tpl +++ b/view/theme/frio/templates/moderation/users/blocked.tpl @@ -20,7 +20,7 @@ {{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])) }} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -100,28 +100,28 @@ {{if $order_users != $th_users.2.1}}

- + ↕ {{$th_users.2.0}} : {{$u.register_date}}

{{/if}} {{if $order_users != $th_users.3.1}}

- + ↕ {{$th_users.3.0}} : {{$u.login_date}}

{{/if}} {{if $order_users != $th_users.4.1}}

- + ↕ {{$th_users.4.0}} : {{$u.lastitem_date}}

{{/if}} {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}

- + ↕ {{$th_users.5.0}} : {{$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}}

{{/if}} @@ -130,11 +130,11 @@ {{if $u.is_deletable}} {{if $u.blocked}} - + {{/if}} - + {{else}} diff --git a/view/theme/frio/templates/moderation/users/index.tpl b/view/theme/frio/templates/moderation/users/index.tpl index d46a41c7ab..c0abae5000 100644 --- a/view/theme/frio/templates/moderation/users/index.tpl +++ b/view/theme/frio/templates/moderation/users/index.tpl @@ -4,7 +4,7 @@

{{$title}} - {{$page}} ({{$count}})

- {{$h_newuser}} + {{$h_newuser}}

@@ -21,7 +21,7 @@ {{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])) }} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -102,28 +102,28 @@ {{if $order_users != $th_users.2.1}}

- + ↕ {{$th_users.2.0}} : {{$u.register_date}}

{{/if}} {{if $order_users != $th_users.3.1}}

- + ↕ {{$th_users.3.0}} : {{$u.login_date}}

{{/if}} {{if $order_users != $th_users.4.1}}

- + ↕ {{$th_users.4.0}} : {{$u.lastitem_date}}

{{/if}} {{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}

- + ↕ {{$th_users.5.0}} : {{$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}}

{{/if}} @@ -132,15 +132,15 @@ {{if $u.is_deletable}} {{if $u.blocked}} - + {{else}} - + {{/if}} - + {{else}} diff --git a/view/theme/frio/templates/moderation/users/pending.tpl b/view/theme/frio/templates/moderation/users/pending.tpl index dfb8d7e101..dbe54029e3 100644 --- a/view/theme/frio/templates/moderation/users/pending.tpl +++ b/view/theme/frio/templates/moderation/users/pending.tpl @@ -33,8 +33,8 @@ {{$u.name}} {{$u.email}} - - + + {{if $u.note}} diff --git a/view/theme/quattro/templates/admin/users/active.tpl b/view/theme/quattro/templates/admin/users/active.tpl index 7aef3f3d1c..77d13ab157 100644 --- a/view/theme/quattro/templates/admin/users/active.tpl +++ b/view/theme/quattro/templates/admin/users/active.tpl @@ -22,7 +22,7 @@ {{foreach $th_users as $th}} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -59,10 +59,10 @@ {{if $u.is_deletable}} - + - + {{else}} diff --git a/view/theme/quattro/templates/admin/users/blocked.tpl b/view/theme/quattro/templates/admin/users/blocked.tpl index 09d84b33bc..9ac81d5460 100644 --- a/view/theme/quattro/templates/admin/users/blocked.tpl +++ b/view/theme/quattro/templates/admin/users/blocked.tpl @@ -24,7 +24,7 @@ {{foreach $th_users as $th}} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -61,10 +61,10 @@ {{if $u.is_deletable}} - + - + {{else}} diff --git a/view/theme/quattro/templates/admin/users/index.tpl b/view/theme/quattro/templates/admin/users/index.tpl index a666274761..8ec16ce99d 100644 --- a/view/theme/quattro/templates/admin/users/index.tpl +++ b/view/theme/quattro/templates/admin/users/index.tpl @@ -22,7 +22,7 @@ {{foreach $th_users as $th}} - + {{if $order_users == $th.1}} {{if $order_direction_users == "+"}} ↓ @@ -59,10 +59,10 @@ {{if $u.is_deletable}} - + - + {{else}} @@ -82,6 +82,6 @@ {{$pager nofilter}}

- {{$h_newuser}} + {{$h_newuser}}

diff --git a/view/theme/quattro/templates/admin/users/pending.tpl b/view/theme/quattro/templates/admin/users/pending.tpl index a2f9950148..944f9af281 100644 --- a/view/theme/quattro/templates/admin/users/pending.tpl +++ b/view/theme/quattro/templates/admin/users/pending.tpl @@ -38,10 +38,10 @@ - + - +