From b360b553eddf3a7ad01c06f7b050b1a69734cdc7 Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Sat, 11 Jan 2025 20:07:18 +0100 Subject: [PATCH] Ratioed: remove actions --- ratioed/RatioedPanel.php | 30 ++++-------------------------- ratioed/templates/ratioed.tpl | 26 ++------------------------ 2 files changed, 6 insertions(+), 50 deletions(-) diff --git a/ratioed/RatioedPanel.php b/ratioed/RatioedPanel.php index 08d94167..19f6dd44 100644 --- a/ratioed/RatioedPanel.php +++ b/ratioed/RatioedPanel.php @@ -24,7 +24,6 @@ class RatioedPanel extends Active return Renderer::replaceMacros($template, array('$config' => DI::baseUrl() . '/settings/addon')); } - $action = $this->parameters['action'] ?? ''; $uid = $this->parameters['uid'] ?? 0; $user = []; @@ -32,31 +31,10 @@ class RatioedPanel extends Active $user = User::getById($uid, ['username', 'blocked']); if (!$user) { $this->systemMessages->addNotice($this->t('User not found')); - $this->baseUrl->redirect('moderation/users'); + $this->baseUrl->redirect('ratioed'); } } - 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 = [ @@ -69,11 +47,11 @@ class RatioedPanel extends Active ]; $order = 'last-item'; - $order_direction = '-'; + $order_direction = '+'; if (!empty($_REQUEST['o'])) { $new_order = $_REQUEST['o']; - if ($new_order[0] === '+') { - $order_direction = '+'; + if ($new_order[0] === '-') { + $order_direction = '-'; $new_order = substr($new_order, 1); } diff --git a/ratioed/templates/ratioed.tpl b/ratioed/templates/ratioed.tpl index c64cb1dc..24ae20b8 100644 --- a/ratioed/templates/ratioed.tpl +++ b/ratioed/templates/ratioed.tpl @@ -11,12 +11,7 @@ - + {{foreach $th_users as $k=>$th}} {{if $k < 2 || $order_users == $th.1 || ($k==4 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.5.1])) }} @@ -42,16 +37,7 @@ {{foreach $users as $u}} - + @@ -151,14 +137,6 @@ {{/foreach}}
-
- - -
-
- {{if $u.is_deletable}} -
- - -
- {{else}} -   - {{/if}} -
{{$u.name}} {{$u.email}}
- {{$pager nofilter}}