mirror of
https://github.com/friendica/friendica
synced 2025-04-25 14:30:10 +00:00
The query condition for active users are unified
This commit is contained in:
parent
692a633dc8
commit
7e73283949
19 changed files with 33 additions and 37 deletions
|
@ -59,7 +59,7 @@ abstract class BaseUsers extends BaseModeration
|
|||
protected function getTabsHTML(string $selectedTab): string
|
||||
{
|
||||
$all = $this->database->count('user', ["`uid` != ?", 0]);
|
||||
$active = $this->database->count('user', ["NOT `blocked` AND `verified` AND NOT `account_removed` AND `uid` != ?", 0]);
|
||||
$active = $this->database->count('user', ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` != ?", 0]);
|
||||
$pending = Register::getPendingCount();
|
||||
$blocked = $this->database->count('user', ['blocked' => true, 'verified' => true, 'account_removed' => false]);
|
||||
$deleted = $this->database->count('user', ['account_removed' => true]);
|
||||
|
|
|
@ -125,7 +125,7 @@ class Active extends BaseUsers
|
|||
|
||||
$th_users = array_map(null, [$this->t('Name'), $this->t('Email'), $this->t('Register date'), $this->t('Last login'), $this->t('Last public item'), $this->t('Type')], $valid_orders);
|
||||
|
||||
$count = $this->database->count('user', ["NOT `blocked` AND `verified` AND NOT `account_removed` AND `uid` != ?", 0]);
|
||||
$count = $this->database->count('user', ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` != ?", 0]);
|
||||
|
||||
$t = Renderer::getMarkupTemplate('moderation/users/active.tpl');
|
||||
return self::getTabsHTML('active') . Renderer::replaceMacros($t, [
|
||||
|
|
|
@ -63,7 +63,7 @@ class PubSub extends \Friendica\BaseModule
|
|||
$nickname = $this->parameters['nickname'] ?? '';
|
||||
$contact_id = $this->parameters['cid'] ?? 0;
|
||||
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if (!$importer) {
|
||||
throw new HTTPException\OKException();
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class PubSub extends \Friendica\BaseModule
|
|||
$this->logger->notice('Subscription start.', ['from' => $this->request->getRemoteAddress(), 'mode' => $hub_mode, 'nickname' => $nickname]);
|
||||
$this->logger->debug('Data: ', ['get' => $request]);
|
||||
|
||||
$owner = $this->database->selectFirst('user', ['uid'], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
|
||||
$owner = $this->database->selectFirst('user', ['uid'], ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if (!$owner) {
|
||||
$this->logger->notice('Local account not found.', ['nickname' => $nickname]);
|
||||
throw new HTTPException\NotFoundException();
|
||||
|
|
|
@ -111,7 +111,7 @@ class PubSubHubBub extends \Friendica\BaseModule
|
|||
}
|
||||
|
||||
// fetch user from database given the nickname
|
||||
$condition = ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false];
|
||||
$condition = ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false];
|
||||
$owner = $this->database->selectFirst('user', ['uid', 'nickname'], $condition);
|
||||
if (!$owner) {
|
||||
$this->logger->notice('Local account not found', ['nickname' => $nickname, 'topic' => $hub_topic, 'callback' => $hub_callback]);
|
||||
|
|
|
@ -74,7 +74,7 @@ class Salmon extends \Friendica\BaseModule
|
|||
|
||||
$this->logger->debug('New Salmon', ['nickname' => $nickname, 'xml' => $xml]);
|
||||
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'account_expired' => false, 'account_removed' => false]);
|
||||
$importer = $this->database->selectFirst('user', [], ['nickname' => $nickname, 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if (!$this->database->isResult($importer)) {
|
||||
throw new HTTPException\InternalServerErrorException();
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ class Profile extends BaseProfile
|
|||
protected function rawContent(array $request = [])
|
||||
{
|
||||
if (ActivityPub::isRequest()) {
|
||||
$user = $this->database->selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'] ?? '', 'account_removed' => false]);
|
||||
$user = $this->database->selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'] ?? '', 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
|
||||
if ($user) {
|
||||
try {
|
||||
$data = ActivityPub\Transmitter::getProfile($user['uid'], ActivityPub::isAcceptedRequester($user['uid']));
|
||||
|
|
|
@ -60,7 +60,7 @@ class OpenID extends BaseModule
|
|||
// in commit 8367cadeeffec4b6792a502847304b17ceba5882, so it might
|
||||
// have left mixed records in the user table
|
||||
//
|
||||
$condition = ['blocked' => false, 'account_expired' => false, 'account_removed' => false, 'verified' => true,
|
||||
$condition = ['verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false,
|
||||
'openid' => [$authId, Strings::normaliseOpenID($authId)]];
|
||||
|
||||
$dba = DI::dba();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue