]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #6364 from rabuzarus/20190102_-_fix_magic_links_for_remote_users
authorMichael Vogel <icarus@dabo.de>
Thu, 3 Jan 2019 17:04:36 +0000 (18:04 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Jan 2019 17:04:36 +0000 (18:04 +0100)
Bugfix - the remote user also has magicLinks again

src/Model/Contact.php

index 4a63a6b49a5084d695ff91bf23a05c8350e13bcd..25434e25a0ab9f6c79112fa76b5835f2ee098749 100644 (file)
@@ -2072,7 +2072,7 @@ class Contact extends BaseObject
         */
        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;
                }
 
@@ -2097,7 +2097,7 @@ class Contact extends BaseObject
                $contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'uid'], ['id' => $cid]);
 
                return self::magicLinkbyContact($contact, $url);
-        }
+       }
 
        /**
         * @brief Returns a magic link to authenticate remote visitors
@@ -2109,7 +2109,7 @@ class Contact extends BaseObject
         */
        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'];
                }