]> git.mxchange.org Git - friendica.git/commitdiff
Partially revert "Improve search for user in Modration module"
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 23 Jan 2025 02:36:32 +0000 (21:36 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 23 Jan 2025 02:37:39 +0000 (21:37 -0500)
This reverts commit 78444ff25cfb0e30d79b78e4744a8b84aa06c52a.
↪️ When the uid parameter isn't set, the regular list should be shown instead of throwing an error.

src/Module/Moderation/Users/Active.php
src/Module/Moderation/Users/Blocked.php
src/Module/Moderation/Users/Index.php

index b16efa46ae889364f6101a262eff9517a7096617..f25bb40ed2779917708e4dcfbd685a92263ecafd 100644 (file)
@@ -51,15 +51,12 @@ class Active extends BaseUsers
                $action = (string) $this->parameters['action'] ?? '';
                $uid    = (int) $this->parameters['uid'] ?? 0;
 
-               if ($uid === 0) {
-                       $this->systemMessages->addNotice($this->t('User not found'));
-                       $this->baseUrl->redirect('moderation/users');
-               }
-
-               $user = User::getById($uid, ['username', 'blocked']);
-               if (!is_array($user)) {
-                       $this->systemMessages->addNotice($this->t('User not found'));
-                       $this->baseUrl->redirect('moderation/users');
+               if ($uid !== 0) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('moderation/users');
+                       }
                }
 
                switch ($action) {
index 6eeb11549f45174b7d7606f435d7361986a74469..6d4d1cce163a99ed80a47d808ef38165d01816b7 100644 (file)
@@ -51,15 +51,12 @@ class Blocked extends BaseUsers
                $action = (string) $this->parameters['action'] ?? '';
                $uid    = (int) $this->parameters['uid'] ?? 0;
 
-               if ($uid === 0) {
-                       $this->systemMessages->addNotice($this->t('User not found'));
-                       $this->baseUrl->redirect('moderation/users');
-               }
-
-               $user = User::getById($uid, ['username', 'blocked']);
-               if (!is_array($user)) {
-                       $this->systemMessages->addNotice($this->t('User not found'));
-                       $this->baseUrl->redirect('moderation/users');
+               if ($uid !== 0) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('moderation/users');
+                       }
                }
 
                switch ($action) {
index 1a7d8f172115efc46f92b562ee11f4c745795f2d..61208d3403fae23f9ea39b50c6ce961d8a10fb05 100644 (file)
@@ -58,15 +58,12 @@ class Index extends BaseUsers
                $action = (string) $this->parameters['action'] ?? '';
                $uid    = (int) $this->parameters['uid'] ?? 0;
 
-               if ($uid === 0) {
-                       $this->systemMessages->addNotice($this->t('User not found'));
-                       $this->baseUrl->redirect('moderation/users');
-               }
-
-               $user = User::getById($uid, ['username', 'blocked']);
-               if (!is_array($user)) {
-                       $this->systemMessages->addNotice($this->t('User not found'));
-                       $this->baseUrl->redirect('moderation/users');
+               if ($uid !== 0) {
+                       $user = User::getById($uid, ['username', 'blocked']);
+                       if (!$user) {
+                               $this->systemMessages->addNotice($this->t('User not found'));
+                               $this->baseUrl->redirect('moderation/users');
+                       }
                }
 
                switch ($action) {