2019-05-18 20:17:57 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Friendica\Module;
|
|
|
|
|
|
|
|
use Friendica\BaseModule;
|
2019-12-15 21:34:11 +00:00
|
|
|
use Friendica\DI;
|
2019-05-18 20:17:57 +00:00
|
|
|
use Friendica\Model\Contact;
|
|
|
|
use Friendica\Model\GContact;
|
|
|
|
|
|
|
|
/**
|
2019-05-19 01:12:22 +00:00
|
|
|
* Redirects to a random Friendica profile this node knows about
|
2019-05-18 20:17:57 +00:00
|
|
|
*/
|
|
|
|
class RandomProfile extends BaseModule
|
|
|
|
{
|
2019-11-05 21:48:54 +00:00
|
|
|
public static function content(array $parameters = [])
|
2019-05-18 20:17:57 +00:00
|
|
|
{
|
2019-12-15 21:34:11 +00:00
|
|
|
$a = DI::app();
|
2019-05-18 20:17:57 +00:00
|
|
|
|
|
|
|
$contactUrl = GContact::getRandomUrl();
|
|
|
|
|
|
|
|
if ($contactUrl) {
|
|
|
|
$link = Contact::magicLink($contactUrl);
|
|
|
|
$a->redirect($link);
|
|
|
|
}
|
|
|
|
|
|
|
|
$a->internalRedirect('profile');
|
|
|
|
}
|
|
|
|
}
|