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