mirror of
https://github.com/friendica/friendica
synced 2024-12-22 22:00:16 +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();
|
parent::content();
|
||||||
|
|
||||||
$action = $this->parameters['action'] ?? '';
|
$action = (string) $this->parameters['action'] ?? '';
|
||||||
$uid = $this->parameters['uid'] ?? 0;
|
$uid = (int) $this->parameters['uid'] ?? 0;
|
||||||
|
|
||||||
if ($uid) {
|
if ($uid === 0) {
|
||||||
$user = User::getById($uid, ['username', 'blocked']);
|
|
||||||
if (!$user) {
|
|
||||||
$this->systemMessages->addNotice($this->t('User not found'));
|
$this->systemMessages->addNotice($this->t('User not found'));
|
||||||
$this->baseUrl->redirect('moderation/users');
|
$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) {
|
switch ($action) {
|
||||||
|
|
|
@ -48,15 +48,18 @@ class Blocked extends BaseUsers
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
$action = $this->parameters['action'] ?? '';
|
$action = (string) $this->parameters['action'] ?? '';
|
||||||
$uid = $this->parameters['uid'] ?? 0;
|
$uid = (int) $this->parameters['uid'] ?? 0;
|
||||||
|
|
||||||
if ($uid) {
|
if ($uid === 0) {
|
||||||
$user = User::getById($uid, ['username', 'blocked']);
|
|
||||||
if (!$user) {
|
|
||||||
$this->systemMessages->addNotice($this->t('User not found'));
|
$this->systemMessages->addNotice($this->t('User not found'));
|
||||||
$this->baseUrl->redirect('moderation/users');
|
$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) {
|
switch ($action) {
|
||||||
|
|
|
@ -55,15 +55,18 @@ class Index extends BaseUsers
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
$action = $this->parameters['action'] ?? '';
|
$action = (string) $this->parameters['action'] ?? '';
|
||||||
$uid = $this->parameters['uid'] ?? 0;
|
$uid = (int) $this->parameters['uid'] ?? 0;
|
||||||
|
|
||||||
if ($uid) {
|
if ($uid === 0) {
|
||||||
$user = User::getById($uid, ['username', 'blocked']);
|
|
||||||
if (!$user) {
|
|
||||||
$this->systemMessages->addNotice($this->t('User not found'));
|
$this->systemMessages->addNotice($this->t('User not found'));
|
||||||
$this->baseUrl->redirect('moderation/users');
|
$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) {
|
switch ($action) {
|
||||||
|
|
Loading…
Reference in a new issue