$contact = DBA::selectFirst('contact', $fields, ['id' => $cid, 'uid' => [0, local_user()]]);
if (!DBA::isResult($contact)) {
notice(L10n::t('Contact not found.'));
- goaway(System::baseUrl());
+ $a->redirect();
}
$contact_url = $contact['url'];
|| (!local_user() && !remote_user()) // Visitors (not logged in or not remotes) can't authenticate.
|| (!empty($a->contact['id']) && $a->contact['id'] == $cid)) // Local user is already authenticated.
{
- goaway($url != '' ? $url : $contact_url);
+ $a->redirect($url != '' ? $url : $contact_url);
}
if ($contact['uid'] == 0 && local_user()) {
// Local user is already authenticated.
$target_url = $url != '' ? $url : $contact_url;
logger($contact['name'] . " is already authenticated. Redirecting to " . $target_url, LOGGER_DEBUG);
- goaway($target_url);
+ $a->redirect($target_url);
}
}
// Remote user is already authenticated.
$target_url = $url != '' ? $url : $contact_url;
logger($contact['name'] . " is already authenticated. Redirecting to " . $target_url, LOGGER_DEBUG);
- goaway($target_url);
+ $a->redirect($target_url);
}
}
}
$dest = (!empty($url) ? '&destination_url=' . $url : '');
- goaway($contact['poll'] . '?dfrn_id=' . $dfrn_id
+ $a->redirect($contact['poll'] . '?dfrn_id=' . $dfrn_id
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet);
}
}
logger('redirecting to ' . $url, LOGGER_DEBUG);
- goaway($url);
+ $a->redirect($url);
}
notice(L10n::t('Contact not found.'));
- goaway(System::baseUrl());
+ $a->redirect();
}