X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FContact%2FAdvanced.php;h=5420390aa606f44b087df25e60ae949a982ad302;hb=79235b6db1c9badd6c9602d54ad0d550e4bec2fd;hp=bbb1d59e0d671142987449790811b6af76c22f2c;hpb=b065318366301f57a0a7aaf33f1429e73dfc991c;p=friendica.git diff --git a/src/Module/Contact/Advanced.php b/src/Module/Contact/Advanced.php index bbb1d59e0d..5420390aa6 100644 --- a/src/Module/Contact/Advanced.php +++ b/src/Module/Contact/Advanced.php @@ -28,8 +28,8 @@ use Friendica\Content\Widget; use Friendica\Core\L10n; use Friendica\Core\Protocol; use Friendica\Core\Renderer; -use Friendica\Core\Session; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Model; use Friendica\Module\Contact; use Friendica\Module\Response; @@ -56,7 +56,7 @@ class Advanced extends BaseModule $this->dba = $dba; $this->page = $page; - if (!Session::isAuthenticated()) { + if (!DI::userSession()->isAuthenticated()) { throw new ForbiddenException($this->t('Permission denied.')); } } @@ -65,7 +65,7 @@ class Advanced extends BaseModule { $cid = $this->parameters['id']; - $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]); + $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()]); if (empty($contact)) { throw new BadRequestException($this->t('Contact not found.')); } @@ -86,7 +86,7 @@ class Advanced extends BaseModule 'nurl' => $nurl, 'poll' => $poll, ], - ['id' => $contact['id'], 'uid' => local_user()] + ['id' => $contact['id'], 'uid' => DI::userSession()->getLocalUserId()] ); if ($photo) { @@ -96,7 +96,7 @@ class Advanced extends BaseModule } if (!$r) { - notice($this->t('Contact update failed.')); + DI::sysmsg()->addNotice($this->t('Contact update failed.')); } } @@ -104,7 +104,7 @@ class Advanced extends BaseModule { $cid = $this->parameters['id']; - $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]); + $contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => DI::userSession()->getLocalUserId()]); if (empty($contact)) { throw new BadRequestException($this->t('Contact not found.')); }