]> git.mxchange.org Git - friendica.git/blob - src/Module/FollowConfirm.php
Merge pull request #8911 from MrPetovan/task/curl_DI
[friendica.git] / src / Module / FollowConfirm.php
1 <?php
2 namespace Friendica\Module;
3
4 use Friendica\BaseModule;
5 use Friendica\DI;
6
7 /**
8  * Process follow request confirmations
9  */
10 class FollowConfirm extends BaseModule
11 {
12         public static function post(array $parameters = [])
13         {
14                 $uid = local_user();
15                 if (!$uid) {
16                         notice(DI::l10n()->t('Permission denied.'));
17                         return;
18                 }
19
20                 $intro_id = intval($_POST['intro_id']   ?? 0);
21                 $duplex   = intval($_POST['duplex']     ?? 0);
22                 $hidden   = intval($_POST['hidden']     ?? 0);
23
24                 $intro = DI::intro()->selectFirst(['id' => $intro_id, 'uid' => local_user()]);
25
26                 $cid = $intro->{'contact-id'};
27
28                 $intro->confirm($duplex, $hidden);
29
30                 DI::baseUrl()->redirect('contact/' . intval($cid));
31         }
32 }