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