Merge pull request #7164 from nupplaphil/task/mod_randprof

Move mod/randprof to src/Module/RandomProfile
This commit is contained in:
Hypolite Petovan 2019-05-18 22:16:06 -04:00 committed by GitHub
commit 596e95917e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 52 additions and 34 deletions

View file

@ -0,0 +1,27 @@
<?php
namespace Friendica\Module;
use Friendica\BaseModule;
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()
{
$a = self::getApp();
$contactUrl = GContact::getRandomUrl();
if ($contactUrl) {
$link = Contact::magicLink($contactUrl);
$a->redirect($link);
}
$a->internalRedirect('profile');
}
}