X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FMagic.php;h=c300e5971e4bddd4f0d550d443d906ec78c47f7d;hb=10f8631cd9423629d5189ae71d82964e4db18892;hp=c47a7a4d504dffce50bf9e1acd7647692c8accf3;hpb=fd7c1d766c2c922909b858f7af6aa440fbc697aa;p=friendica.git diff --git a/src/Module/Magic.php b/src/Module/Magic.php index c47a7a4d50..c300e5971e 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -1,6 +1,6 @@ app = $app; - $this->logger = $logger; - $this->dba = $dba; - $this->httpClient = $httpClient; - $this->baseUrl = $baseUrl; + $this->app = $app; + $this->dba = $dba; + $this->httpClient = $httpClient; + $this->userSession = $userSession; } - public function rawContent() + protected function rawContent(array $request = []) { $this->logger->info('magic module: invoked'); @@ -93,8 +94,8 @@ class Magic extends BaseModule } // OpenWebAuth - if (local_user() && $owa) { - $user = User::getById(local_user()); + if ($this->userSession->getLocalUserId() && $owa) { + $user = User::getById($this->userSession->getLocalUserId()); // Extract the basepath // NOTE: we need another solution because this does only work @@ -116,7 +117,7 @@ class Magic extends BaseModule ); // Try to get an authentication token from the other instance. - $curlResult = $this->httpClient->get($basepath . '/owa', [HttpClientOptions::HEADERS => $header]); + $curlResult = $this->httpClient->get($basepath . '/owa', HttpClientAccept::DEFAULT, [HttpClientOptions::HEADERS => $header]); if ($curlResult->isSuccess()) { $j = json_decode($curlResult->getBody(), true);