2012-04-11 03:50:31 +00:00
|
|
|
<?php
|
2018-01-15 02:22:39 +00:00
|
|
|
/**
|
|
|
|
* @file mod/randprof.php
|
|
|
|
*/
|
2017-04-30 04:07:00 +00:00
|
|
|
use Friendica\App;
|
2017-08-26 06:04:21 +00:00
|
|
|
use Friendica\Core\System;
|
2018-06-02 08:05:06 +00:00
|
|
|
use Friendica\Model\Contact;
|
2017-12-07 14:09:28 +00:00
|
|
|
use Friendica\Model\GContact;
|
2018-01-15 02:22:39 +00:00
|
|
|
use Friendica\Model\Profile;
|
2016-02-07 14:11:34 +00:00
|
|
|
|
2018-01-15 02:22:39 +00:00
|
|
|
function randprof_init(App $a)
|
|
|
|
{
|
2017-12-07 14:09:28 +00:00
|
|
|
$x = GContact::getRandomUrl();
|
2016-12-20 10:38:16 +00:00
|
|
|
|
|
|
|
if ($x) {
|
2018-10-19 23:00:01 +00:00
|
|
|
$link = Contact::magicLink($x);
|
|
|
|
// @TODO making the return of magicLink save to use either externalRedirect or internalRedirect
|
|
|
|
if (filter_var($link, FILTER_VALIDATE_URL)) {
|
|
|
|
System::externalRedirect($link);
|
|
|
|
} else {
|
|
|
|
$a->internalRedirect($link);
|
|
|
|
}
|
2016-12-20 10:38:16 +00:00
|
|
|
}
|
|
|
|
|
2018-10-19 18:11:27 +00:00
|
|
|
$a->internalRedirect('profile');
|
2012-04-11 03:50:31 +00:00
|
|
|
}
|