*/
public static function magicLink($contact_url, $url = '')
{
- if (!local_user()) {
+ if (!local_user() && remote_user()) {
return $url ?: $contact_url; // Equivalent to: ($url != '') ? $url : $contact_url;
}
$contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'uid'], ['id' => $cid]);
return self::magicLinkbyContact($contact, $url);
- }
+ }
/**
* @brief Returns a magic link to authenticate remote visitors
*/
public static function magicLinkbyContact($contact, $url = '')
{
- if (!local_user() || ($contact['network'] != Protocol::DFRN)) {
+ if ((!local_user() && !remote_user()) || ($contact['network'] != Protocol::DFRN)) {
return $url ?: $contact['url']; // Equivalent to ($url != '') ? $url : $contact['url'];
}