use Friendica\App;
use Friendica\Core\Config;
use Friendica\Core\L10n;
+use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
function dfrn_request_post(App $a)
{
if (($a->argc != 2) || (!count($a->profile))) {
- logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
+ Logger::log('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
return;
}
if (x($_POST, 'cancel')) {
- goaway(System::baseUrl());
+ $a->internalRedirect();
}
/*
Contact::updateAvatar($photo, local_user(), $r[0]["id"], true);
}
- $forwardurl = System::baseUrl() . "/contacts/" . $r[0]['id'];
+ $forward_path = "contact/" . $r[0]['id'];
} else {
- $forwardurl = System::baseUrl() . "/contacts";
+ $forward_path = "contact";
}
// Allow the blocked remote notification to complete
}
// (ignore reply, nothing we can do it failed)
- goaway($forwardurl);
+ $a->internalRedirect($forward_path);
return; // NOTREACHED
}
}
// invalid/bogus request
notice(L10n::t('Unrecoverable protocol error.') . EOL);
- goaway(System::baseUrl());
+ $a->internalRedirect();
return; // NOTREACHED
}
$network = Protocol::DFRN;
}
- logger('dfrn_request: url: ' . $url . ',network=' . $network, LOGGER_DEBUG);
+ Logger::log('dfrn_request: url: ' . $url . ',network=' . $network, Logger::DEBUG);
if ($network === Protocol::DFRN) {
$ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1",
$url = Network::isUrlValid($url);
if (!$url) {
notice(L10n::t('Invalid profile URL.') . EOL);
- goaway(System::baseUrl() . '/' . $a->cmd);
+ $a->internalRedirect($a->cmd);
return; // NOTREACHED
}
if (!Network::isUrlAllowed($url)) {
notice(L10n::t('Disallowed profile URL.') . EOL);
- goaway(System::baseUrl() . '/' . $a->cmd);
+ $a->internalRedirect($a->cmd);
return; // NOTREACHED
}
if (Network::isUrlBlocked($url)) {
notice(L10n::t('Blocked domain') . EOL);
- goaway(System::baseUrl() . '/' . $a->cmd);
+ $a->internalRedirect($a->cmd);
return; // NOTREACHED
}
if (!count($parms)) {
notice(L10n::t('Profile location is not valid or does not contain profile information.') . EOL);
- goaway(System::baseUrl() . '/' . $a->cmd);
+ $a->internalRedirect($a->cmd);
} else {
if (!x($parms, 'fn')) {
notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
}
// "Homecoming" - send the requestor back to their site to record the introduction.
- $dfrn_url = bin2hex(System::baseUrl() . '/profile/' . $nickname);
+ $dfrn_url = bin2hex($a->getBaseURL() . '/profile/' . $nickname);
$aes_allow = ((function_exists('openssl_encrypt')) ? 1 : 0);
- goaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url"
+ System::externalRedirect($parms['dfrn-request'] . "?dfrn_url=$dfrn_url"
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
. '&confirm_key=' . $hash
. (($aes_allow) ? "&aes_allow=1" : "")
$uri = urlencode($uri);
} else {
- $uri = System::baseUrl() . '/profile/' . $nickname;
+ $uri = 'profile/' . $nickname;
}
$url = str_replace('{uri}', $uri, $url);
- goaway($url);
+ System::externalRedirect($url);
// NOTREACHED
// END $network != Protocol::PHANTOM
} else {