mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:40:17 +00:00
Improve search for user in Modration module
This commit is contained in:
parent
3d97280f52
commit
78444ff25c
3 changed files with 33 additions and 24 deletions
|
@ -48,15 +48,18 @@ class Active extends BaseUsers
|
|||
{
|
||||
parent::content();
|
||||
|
||||
$action = $this->parameters['action'] ?? '';
|
||||
$uid = $this->parameters['uid'] ?? 0;
|
||||
$action = (string) $this->parameters['action'] ?? '';
|
||||
$uid = (int) $this->parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
if (!$user) {
|
||||
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');
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
|
|
@ -48,15 +48,18 @@ class Blocked extends BaseUsers
|
|||
{
|
||||
parent::content();
|
||||
|
||||
$action = $this->parameters['action'] ?? '';
|
||||
$uid = $this->parameters['uid'] ?? 0;
|
||||
$action = (string) $this->parameters['action'] ?? '';
|
||||
$uid = (int) $this->parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
if (!$user) {
|
||||
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');
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
|
|
@ -55,15 +55,18 @@ class Index extends BaseUsers
|
|||
{
|
||||
parent::content();
|
||||
|
||||
$action = $this->parameters['action'] ?? '';
|
||||
$uid = $this->parameters['uid'] ?? 0;
|
||||
$action = (string) $this->parameters['action'] ?? '';
|
||||
$uid = (int) $this->parameters['uid'] ?? 0;
|
||||
|
||||
if ($uid) {
|
||||
$user = User::getById($uid, ['username', 'blocked']);
|
||||
if (!$user) {
|
||||
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');
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
|
|
Loading…
Reference in a new issue