X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsuggest.php;h=adf41c0c60c6cadd501d0500409ef331a5f52ba6;hb=28e2eab7aee3ab5dac11fcc62be595b9a1c2df8b;hp=4b67dd6eb8e7930b6d217c7dc46024d55707956f;hpb=9b91b0550d0220377c1fce3dc3d0875f07552d6a;p=friendica.git diff --git a/mod/suggest.php b/mod/suggest.php index 4b67dd6eb8..adf41c0c60 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -1,124 +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.')); - } - - $a->internalRedirect('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'] = $a->cmd; + $_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'])) { - //