X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsuggest.php;h=adf41c0c60c6cadd501d0500409ef331a5f52ba6;hb=622b978a8444624b36b01853239a2959cb4a1bf5;hp=15370d25a9bdcfb4355c2f36d6a9b6428ef8687b;hpb=3c76826793feeb933dab7a07dab7cc7eb2efc451;p=friendica.git diff --git a/mod/suggest.php b/mod/suggest.php index 15370d25a9..adf41c0c60 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -1,125 +1,58 @@ . + * */ use Friendica\App; -use Friendica\Content\ContactSelector; use Friendica\Content\Widget; -use Friendica\Core\L10n; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; -use Friendica\Model\GContact; -use Friendica\Util\Proxy as ProxyUtils; - -function suggest_init(App $a) -{ - if (! local_user()) { - return; - } -} - -function suggest_post(App $a) -{ - if (!empty($_POST['ignore']) && !empty($_POST['confirm'])) { - DBA::insert('gcign', ['uid' => local_user(), 'gcid' => $_POST['ignore']]); - notice(L10n::t('Contact suggestion successfully ignored.')); - } - - DI::baseUrl()->redirect('suggest'); -} +use Friendica\Module\Contact as ModuleContact; +use Friendica\Network\HTTPException; function suggest_content(App $a) { - $o = ''; - - if (! local_user()) { - notice(L10n::t('Permission denied.') . EOL); - return; + if (!local_user()) { + throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.')); } $_SESSION['return_path'] = DI::args()->getCommand(); - $a->page['aside'] .= Widget::findPeople(); - $a->page['aside'] .= Widget::follow(); + DI::page()['aside'] .= Widget::findPeople(); + DI::page()['aside'] .= Widget::follow(); - - $r = GContact::suggestionQuery(local_user()); - - if (! DBA::isResult($r)) { - $o .= L10n::t('No suggestions available. If this is a new site, please try again in 24 hours.'); - return $o; - } - - - if (!empty($_GET['ignore'])) { - //