X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsuggest.php;h=c18de1bd3dc46ea26db8c113ca225afd25629946;hb=00382dd39e052a239be56828472354c9a14c87f0;hp=31f02fa4ce6640e04550a94d61237fe0a248359d;hpb=3f3422975266835fc125d1d61aae85ccc10d96d9;p=friendica.git diff --git a/mod/suggest.php b/mod/suggest.php index 31f02fa4ce..c18de1bd3d 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -1,43 +1,37 @@ . + * */ use Friendica\App; -use Friendica\Content\ContactSelector; use Friendica\Content\Widget; -use Friendica\Core\L10n; use Friendica\Core\Renderer; 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(); @@ -45,80 +39,20 @@ function suggest_content(App $a) 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'])) { - //