]> git.mxchange.org Git - friendica.git/blobdiff - mod/redir.php
Merge pull request #5899 from annando/avoid-flooding
[friendica.git] / mod / redir.php
index 28d20b65a2175a8a92d5aba8d14fe3e2d648ba1b..e989ad015a83045b5f98ce9e202e416bce03731a 100644 (file)
@@ -23,7 +23,7 @@ function redir_init(App $a) {
        }
 
        if (!empty($cid)) {
-               $fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name', 'network', 'poll', 'issued-id', 'dfrn-id', 'duplex'];
+               $fields = ['id', 'uid', 'nurl', 'url', 'addr', 'name', 'network', 'poll', 'issued-id', 'dfrn-id', 'duplex', 'pending'];
                $contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
                if (!DBA::isResult($contact)) {
                        notice(L10n::t('Contact not found.'));
@@ -57,7 +57,7 @@ function redir_init(App $a) {
                }
 
                if (remote_user()) {
-                       $host = substr(System::baseUrl() . ($a->urlpath ? '/' . $a->urlpath : ''), strpos(System::baseUrl(), '://') + 3);
+                       $host = substr(System::baseUrl() . ($a->getURLPath() ? '/' . $a->getURLPath() : ''), strpos(System::baseUrl(), '://') + 3);
                        $remotehost = substr($contact['addr'], strpos($contact['addr'], '@') + 1);
 
                        // On a local instance we have to check if the local user has already authenticated
@@ -80,7 +80,7 @@ function redir_init(App $a) {
                }
 
                // Doing remote auth with dfrn.
-               if (local_user() && (!empty($contact['dfrn-id']) || !empty($contact['issued-id']))) {
+               if (local_user() && (!empty($contact['dfrn-id']) || !empty($contact['issued-id'])) && empty($contact['pending'])) {
                        $dfrn_id = $orig_id = (($contact['issued-id']) ? $contact['issued-id'] : $contact['dfrn-id']);
 
                        if ($contact['duplex'] && $contact['issued-id']) {