]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/FriendSuggest.php
Merge pull request #12409 from annando/diaspora-reshare
[friendica.git] / src / Module / FriendSuggest.php
index 815c4e1ec89c2ca1453e644898d245159c93026e..71d373000ff1e9a8bc25ac4ace64afcb2bdf1644 100644 (file)
@@ -53,7 +53,7 @@ class FriendSuggest extends BaseModule
        {
                parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
 
-               if (!local_user()) {
+               if (!DI::userSession()->getLocalUserId()) {
                        throw new ForbiddenException($this->t('Permission denied.'));
                }
 
@@ -67,7 +67,7 @@ class FriendSuggest extends BaseModule
                $cid = intval($this->parameters['contact']);
 
                // We do query the "uid" as well to ensure that it is our contact
-               if (!$this->dba->exists('contact', ['id' => $cid, 'uid' => local_user()])) {
+               if (!$this->dba->exists('contact', ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()])) {
                        throw new NotFoundException($this->t('Contact not found.'));
                }
 
@@ -77,7 +77,7 @@ class FriendSuggest extends BaseModule
                }
 
                // We do query the "uid" as well to ensure that it is our contact
-               $contact = $this->dba->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => local_user()]);
+               $contact = $this->dba->selectFirst('contact', ['name', 'url', 'request', 'avatar'], ['id' => $suggest_contact_id, 'uid' => DI::userSession()->getLocalUserId()]);
                if (empty($contact)) {
                        DI::sysmsg()->addNotice($this->t('Suggested contact not found.'));
                        return;
@@ -86,7 +86,7 @@ class FriendSuggest extends BaseModule
                $note = Strings::escapeHtml(trim($_POST['note'] ?? ''));
 
                $suggest = $this->friendSuggestRepo->save($this->friendSuggestFac->createNew(
-                       local_user(),
+                       DI::userSession()->getLocalUserId(),
                        $cid,
                        $contact['name'],
                        $contact['url'],
@@ -104,7 +104,7 @@ class FriendSuggest extends BaseModule
        {
                $cid = intval($this->parameters['contact']);
 
-               $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => local_user()]);
+               $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()]);
                if (empty($contact)) {
                        DI::sysmsg()->addNotice($this->t('Contact not found.'));
                        $this->baseUrl->redirect();
@@ -120,7 +120,7 @@ class FriendSuggest extends BaseModule
                        AND NOT `archive` 
                        AND NOT `deleted` 
                        AND `notify` != ""',
-                       local_user(),
+                       DI::userSession()->getLocalUserId(),
                        $cid,
                        Protocol::DFRN,
                ]);