]> git.mxchange.org Git - friendica.git/blob - src/Module/RandomProfile.php
Move Config::get() to DI::config()->get()
[friendica.git] / src / Module / RandomProfile.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6 use Friendica\DI;
7 use Friendica\Model\Contact;
8 use Friendica\Model\GContact;
9
10 /**
11  * Redirects to a random Friendica profile this node knows about
12  */
13 class RandomProfile extends BaseModule
14 {
15         public static function content(array $parameters = [])
16         {
17                 $a = DI::app();
18
19                 $contactUrl = GContact::getRandomUrl();
20
21                 if ($contactUrl) {
22                         $link = Contact::magicLink($contactUrl);
23                         $a->redirect($link);
24                 }
25
26                 DI::baseUrl()->redirect('profile');
27         }
28 }