2019-05-06 07:46:13 +02:00
|
|
|
<?php
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
2019-12-15 22:34:11 +01:00
|
|
|
use Friendica\DI;
|
2019-05-06 07:46:13 +02:00
|
|
|
|
2019-05-06 20:46:30 +02:00
|
|
|
/**
|
|
|
|
* Process follow request confirmations
|
|
|
|
*/
|
2019-05-06 07:46:13 +02:00
|
|
|
class FollowConfirm extends BaseModule
|
|
|
|
{
|
2019-11-05 22:48:54 +01:00
|
|
|
public static function post(array $parameters = [])
|
2019-05-06 07:46:13 +02:00
|
|
|
{
|
|
|
|
$uid = local_user();
|
|
|
|
if (!$uid) {
|
2020-07-23 08:25:01 +02:00
|
|
|
notice(DI::l10n()->t('Permission denied.'));
|
2019-05-06 07:46:13 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-10-15 15:20:32 +02:00
|
|
|
$intro_id = intval($_POST['intro_id'] ?? 0);
|
|
|
|
$duplex = intval($_POST['duplex'] ?? 0);
|
|
|
|
$hidden = intval($_POST['hidden'] ?? 0);
|
2019-05-06 07:46:13 +02:00
|
|
|
|
2020-01-05 23:50:33 +01:00
|
|
|
$intro = DI::intro()->selectFirst(['id' => $intro_id, 'uid' => local_user()]);
|
2019-05-06 07:46:13 +02:00
|
|
|
|
2020-01-05 23:50:33 +01:00
|
|
|
$cid = $intro->{'contact-id'};
|
2019-05-06 07:46:13 +02:00
|
|
|
|
2020-01-05 23:50:33 +01:00
|
|
|
$intro->confirm($duplex, $hidden);
|
2019-05-06 07:46:13 +02:00
|
|
|
|
2019-12-16 00:28:31 +01:00
|
|
|
DI::baseUrl()->redirect('contact/' . intval($cid));
|
2019-05-06 07:46:13 +02:00
|
|
|
}
|
|
|
|
}
|