325cc1e6598d1306cb514b7c2daae019ca938755
[friendica.git/.git] / src / Module / RandomProfile.php
1 <?php
2
3 namespace Friendica\Module;
4
5 use Friendica\BaseModule;
6 use Friendica\Model\Contact;
7 use Friendica\Model\GContact;
8
9 /**
10  * Redirects to a random profile of this node
11  */
12 class RandomProfile extends BaseModule
13 {
14         public static function content()
15         {
16                 $a = self::getApp();
17
18                 $contactUrl = GContact::getRandomUrl();
19
20                 if ($contactUrl) {
21                         $link = Contact::magicLink($contactUrl);
22                         $a->redirect($link);
23                 }
24
25                 $a->internalRedirect('profile');
26         }
27 }