mirror of
https://github.com/friendica/friendica
synced 2024-12-27 02:40:16 +00:00
1de3f186d7
- Adding Friendica\DI class for getting dynamic classes - Replacing BaseObject::getApp() with this class
28 lines
509 B
PHP
28 lines
509 B
PHP
<?php
|
|
|
|
namespace Friendica\Module;
|
|
|
|
use Friendica\BaseModule;
|
|
use Friendica\DI;
|
|
use Friendica\Model\Contact;
|
|
use Friendica\Model\GContact;
|
|
|
|
/**
|
|
* Redirects to a random Friendica profile this node knows about
|
|
*/
|
|
class RandomProfile extends BaseModule
|
|
{
|
|
public static function content(array $parameters = [])
|
|
{
|
|
$a = DI::app();
|
|
|
|
$contactUrl = GContact::getRandomUrl();
|
|
|
|
if ($contactUrl) {
|
|
$link = Contact::magicLink($contactUrl);
|
|
$a->redirect($link);
|
|
}
|
|
|
|
$a->internalRedirect('profile');
|
|
}
|
|
}
|