mirror of
https://github.com/friendica/friendica
synced 2025-04-19 08:30:11 +00:00
old boot.php functions replaced in src/module (2)
This commit is contained in:
parent
b36d4eb0dd
commit
c9f17e1ef5
21 changed files with 102 additions and 88 deletions
|
@ -23,6 +23,7 @@ namespace Friendica\Module\Debug;
|
|||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\DI;
|
||||
use Friendica\Protocol\ActivityPub;
|
||||
use Friendica\Util\JsonLD;
|
||||
|
@ -41,7 +42,7 @@ class ActivityPubConversion extends BaseModule
|
|||
try {
|
||||
$source = json_decode($_REQUEST['source'], true);
|
||||
$trust_source = true;
|
||||
$uid = local_user();
|
||||
$uid = Session::getLocalUser();
|
||||
$push = false;
|
||||
|
||||
if (!$source) {
|
||||
|
|
|
@ -25,6 +25,7 @@ use Friendica\App;
|
|||
use Friendica\BaseModule;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model;
|
||||
use Friendica\Module\Response;
|
||||
|
@ -48,7 +49,7 @@ class Feed extends BaseModule
|
|||
|
||||
$this->httpClient = $httpClient;
|
||||
|
||||
if (!local_user()) {
|
||||
if (!Session::getLocalUser()) {
|
||||
DI::sysmsg()->addNotice($this->t('You must be logged in to use this module'));
|
||||
$baseUrl->redirect();
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ class Feed extends BaseModule
|
|||
if (!empty($_REQUEST['url'])) {
|
||||
$url = $_REQUEST['url'];
|
||||
|
||||
$contact = Model\Contact::getByURLForUser($url, local_user(), null);
|
||||
$contact = Model\Contact::getByURLForUser($url, Session::getLocalUser(), null);
|
||||
|
||||
$xml = $this->httpClient->fetch($contact['poll'], HttpClientAccept::FEED_XML);
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
namespace Friendica\Module\Debug;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Post;
|
||||
|
@ -34,7 +35,7 @@ class ItemBody extends BaseModule
|
|||
{
|
||||
protected function content(array $request = []): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
if (!Session::getLocalUser()) {
|
||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Access denied.'));
|
||||
}
|
||||
|
||||
|
@ -44,7 +45,7 @@ class ItemBody extends BaseModule
|
|||
|
||||
$itemId = intval($this->parameters['item']);
|
||||
|
||||
$item = Post::selectFirst(['body'], ['uid' => [0, local_user()], 'uri-id' => $itemId]);
|
||||
$item = Post::selectFirst(['body'], ['uid' => [0, Session::getLocalUser()], 'uri-id' => $itemId]);
|
||||
|
||||
if (!empty($item)) {
|
||||
if (DI::mode()->isAjax()) {
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Module\Debug;
|
|||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\HTTPException;
|
||||
use Friendica\Network\Probe as NetworkProbe;
|
||||
|
@ -34,7 +35,7 @@ class Probe extends BaseModule
|
|||
{
|
||||
protected function content(array $request = []): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
if (!Session::getLocalUser()) {
|
||||
throw new HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ namespace Friendica\Module\Debug;
|
|||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Core\Session;
|
||||
use Friendica\DI;
|
||||
use Friendica\Network\Probe;
|
||||
|
||||
|
@ -33,7 +34,7 @@ class WebFinger extends BaseModule
|
|||
{
|
||||
protected function content(array $request = []): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
if (!Session::getLocalUser()) {
|
||||
throw new \Friendica\Network\HTTPException\ForbiddenException(DI::l10n()->t('Only logged in users are permitted to perform a probing.'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue