X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FFriendSuggest.php;h=a4bdb957dc21a82b432fef44edc32cb24ea8485a;hb=e1863951986ba5be173758324a00652bc5af870c;hp=df509885cdf8c01de29f5690aabeb1e7d1aed145;hpb=d2da2492b76fbc77ad11c8a5482e2674381b2af0;p=friendica.git diff --git a/src/Module/FriendSuggest.php b/src/Module/FriendSuggest.php index df509885cd..a4bdb957dc 100644 --- a/src/Module/FriendSuggest.php +++ b/src/Module/FriendSuggest.php @@ -1,6 +1,6 @@ getLocalUserId()) { throw new ForbiddenException($this->t('Permission denied.')); } @@ -68,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' => Session::getLocalUser()])) { + if (!$this->dba->exists('contact', ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()])) { throw new NotFoundException($this->t('Contact not found.')); } @@ -78,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' => Session::getLocalUser()]); + $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; @@ -87,7 +86,7 @@ class FriendSuggest extends BaseModule $note = Strings::escapeHtml(trim($_POST['note'] ?? '')); $suggest = $this->friendSuggestRepo->save($this->friendSuggestFac->createNew( - Session::getLocalUser(), + DI::userSession()->getLocalUserId(), $cid, $contact['name'], $contact['url'], @@ -105,7 +104,7 @@ class FriendSuggest extends BaseModule { $cid = intval($this->parameters['contact']); - $contact = $this->dba->selectFirst('contact', [], ['id' => $cid, 'uid' => Session::getLocalUser()]); + $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(); @@ -121,7 +120,7 @@ class FriendSuggest extends BaseModule AND NOT `archive` AND NOT `deleted` AND `notify` != ""', - Session::getLocalUser(), + DI::userSession()->getLocalUserId(), $cid, Protocol::DFRN, ]);