2019-05-06 05:46:13 +00:00
|
|
|
<?php
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
|
|
|
use Friendica\Core\L10n;
|
2019-12-11 08:35:13 +00:00
|
|
|
use Friendica\Model\Introduction;
|
2019-12-15 21:34:11 +00:00
|
|
|
use Friendica\DI;
|
2019-05-06 05:46:13 +00:00
|
|
|
|
2019-05-06 18:46:30 +00:00
|
|
|
/**
|
|
|
|
* Process follow request confirmations
|
|
|
|
*/
|
2019-05-06 05:46:13 +00:00
|
|
|
class FollowConfirm extends BaseModule
|
|
|
|
{
|
2019-11-05 21:48:54 +00:00
|
|
|
public static function post(array $parameters = [])
|
2019-05-06 05:46:13 +00:00
|
|
|
{
|
2019-12-15 21:34:11 +00:00
|
|
|
$a = DI::app();
|
2019-05-06 05:46:13 +00:00
|
|
|
|
|
|
|
$uid = local_user();
|
|
|
|
if (!$uid) {
|
|
|
|
notice(L10n::t('Permission denied.') . EOL);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-10-15 13:20:32 +00:00
|
|
|
$intro_id = intval($_POST['intro_id'] ?? 0);
|
|
|
|
$duplex = intval($_POST['duplex'] ?? 0);
|
|
|
|
$hidden = intval($_POST['hidden'] ?? 0);
|
2019-05-06 05:46:13 +00:00
|
|
|
|
2019-12-11 08:35:13 +00:00
|
|
|
/** @var Introduction $Intro */
|
|
|
|
$Intro = self::getClass(Introduction::class);
|
|
|
|
$Intro->fetch(['id' => $intro_id, 'uid' => local_user()]);
|
2019-05-06 05:46:13 +00:00
|
|
|
|
2019-12-11 08:35:13 +00:00
|
|
|
$cid = $Intro->{'contact-id'};
|
2019-05-06 05:46:13 +00:00
|
|
|
|
2019-12-11 08:35:13 +00:00
|
|
|
$Intro->confirm($duplex, $hidden);
|
2019-05-06 05:46:13 +00:00
|
|
|
|
|
|
|
$a->internalRedirect('contact/' . intval($cid));
|
|
|
|
}
|
|
|
|
}
|