mirror of
https://github.com/friendica/friendica
synced 2025-04-22 05:50:13 +00:00
Move mod/randprof to src/Module/RandomProfile
This commit is contained in:
parent
d252598821
commit
8bb85b1da7
5 changed files with 52 additions and 34 deletions
27
src/Module/RandomProfile.php
Normal file
27
src/Module/RandomProfile.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Model\Contact;
|
||||
use Friendica\Model\GContact;
|
||||
|
||||
/**
|
||||
* Redirects to a random profile of this node
|
||||
*/
|
||||
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');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue