Browse Source

Always usa magic on the same server

pull/6325/head
Michael 3 years ago
parent
commit
a565406b47
2 changed files with 7 additions and 6 deletions
  1. +1
    -1
      mod/dfrn_poll.php
  2. +6
    -5
      mod/redir.php

+ 1
- 1
mod/dfrn_poll.php View File

@ -436,7 +436,7 @@ function dfrn_poll_content(App $a)
switch ($direction) {
case -1:
if ($type === 'profile') {
$sql_extra = sprintf(" AND ( `dfrn-id` = '%s' OR `issued-id` = '%s' ) ", DBA::escape($dfrn_id), DBA::escape($dfrn_id));
$sql_extra = sprintf(" AND (`dfrn-id` = '%s' OR `issued-id` = '%s') ", DBA::escape($dfrn_id), DBA::escape($dfrn_id));
} else {
$sql_extra = sprintf(" AND `issued-id` = '%s' ", DBA::escape($dfrn_id));
}


+ 6
- 5
mod/redir.php View File

@ -83,14 +83,15 @@ function redir_init(App $a) {
// When the remote page does support OWA, then we enforce the use of it
$basepath = Contact::getBasepath($contact_url);
$serverret = Network::curl($basepath . '/magic');
if ($serverret->isSuccess()) {
$contact['issued-id'] = '';
$contact['dfrn-id'] = '';
if ($basepath == System::baseUrl()) {
$use_magic = true;
} else {
$serverret = Network::curl($basepath . '/magic');
$use_magic = $serverret->isSuccess();
}
// Doing remote auth with dfrn.
if (local_user() && (!empty($contact['dfrn-id']) || !empty($contact['issued-id'])) && empty($contact['pending'])) {
if (local_user() && !$use_magic && (!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']) {


Loading…
Cancel
Save