X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FSearch%2FAcl.php;h=9f072b91c938df938c70ceb6047b1cda5fcea908;hb=99284222c1d7fb4adca9077e3057faf3b36f7180;hp=e8db9df5330d58f47d8421056d2402d337a6d3ec;hpb=d47d78f2d46eaaf4005b434f6a7cfab37f9a3f0b;p=friendica.git diff --git a/src/Module/Search/Acl.php b/src/Module/Search/Acl.php index e8db9df533..9f072b91c9 100644 --- a/src/Module/Search/Acl.php +++ b/src/Module/Search/Acl.php @@ -27,7 +27,6 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Search; -use Friendica\Core\Session; use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; @@ -52,7 +51,7 @@ class Acl extends BaseModule protected function rawContent(array $request = []) { - if (!Session::getLocalUser()) { + if (!DI::userSession()->getLocalUserId()) { throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.')); } @@ -114,8 +113,8 @@ class Acl extends BaseModule Logger::info('ACL {action} - {subaction} - start', ['module' => 'acl', 'action' => 'content', 'subaction' => 'search', 'search' => $search, 'type' => $type, 'conversation' => $conv_id]); $sql_extra = ''; - $condition = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", Session::getLocalUser()]; - $condition_group = ["`uid` = ? AND NOT `deleted`", Session::getLocalUser()]; + $condition = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", DI::userSession()->getLocalUserId()]; + $condition_group = ["`uid` = ? AND NOT `deleted`", DI::userSession()->getLocalUserId()]; if ($search != '') { $sql_extra = "AND `name` LIKE '%%" . DBA::escape($search) . "%%'"; @@ -136,13 +135,13 @@ class Acl extends BaseModule switch ($type) { case self::TYPE_MENTION_CONTACT_GROUP: $condition = DBA::mergeConditions($condition, - ["NOT `self` AND NOT `blocked` AND `notify` != ? AND NOT `network` IN (?, ?)", '', Protocol::OSTATUS, Protocol::STATUSNET + ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::OSTATUS ]); break; case self::TYPE_MENTION_CONTACT: $condition = DBA::mergeConditions($condition, - ["NOT `self` AND NOT `blocked` AND `notify` != ? AND `network` != ?", '', Protocol::STATUSNET + ["NOT `self` AND NOT `blocked` AND `notify` != ?", '' ]); break; @@ -177,7 +176,7 @@ class Acl extends BaseModule GROUP BY `group`.`name`, `group`.`id` ORDER BY `group`.`name` LIMIT ?, ?", - Session::getLocalUser(), + DI::userSession()->getLocalUserId(), $start, $count )); @@ -252,7 +251,7 @@ class Acl extends BaseModule $condition = ["`parent` = ?", $conv_id]; $params = ['order' => ['author-name' => true]]; - $authors = Post::selectForUser(Session::getLocalUser(), ['author-link'], $condition, $params); + $authors = Post::selectForUser(DI::userSession()->getLocalUserId(), ['author-link'], $condition, $params); $item_authors = []; while ($author = Post::fetch($authors)) { $item_authors[$author['author-link']] = $author['author-link'];