]> git.mxchange.org Git - friendica.git/blob - src/Module/FollowConfirm.php
Merge pull request #7930 from MrPetovan/task/7887-api-followers-request
[friendica.git] / src / Module / FollowConfirm.php
1 <?php
2 namespace Friendica\Module;
3
4 use Friendica\BaseModule;
5 use Friendica\Core\L10n;
6 use Friendica\Model\Introduction;
7
8 /**
9  * Process follow request confirmations
10  */
11 class FollowConfirm extends BaseModule
12 {
13         public static function post(array $parameters = [])
14         {
15                 $a = self::getApp();
16
17                 $uid = local_user();
18                 if (!$uid) {
19                         notice(L10n::t('Permission denied.') . EOL);
20                         return;
21                 }
22
23                 $intro_id = intval($_POST['intro_id']   ?? 0);
24                 $duplex   = intval($_POST['duplex']     ?? 0);
25                 $hidden   = intval($_POST['hidden']     ?? 0);
26
27                 /** @var Introduction $Intro */
28                 $Intro = self::getClass(Introduction::class);
29                 $Intro->fetch(['id' => $intro_id, 'uid' => local_user()]);
30
31                 $cid = $Intro->{'contact-id'};
32
33                 $Intro->confirm($duplex, $hidden);
34
35                 $a->internalRedirect('contact/' . intval($cid));
36         }
37 }