Split goaway to System::externalRedirectTo() and App->internalRedirect()

This commit is contained in:
Philipp Holzer 2018-10-19 20:11:27 +02:00
parent 2ef81108b3
commit d00ddc01af
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
61 changed files with 286 additions and 266 deletions

View file

@ -20,7 +20,7 @@ function follow_post(App $a)
}
if (isset($_REQUEST['cancel'])) {
$a->redirect('contacts');
$a->internalRedirect('contacts');
}
$uid = local_user();
@ -37,14 +37,14 @@ function follow_post(App $a)
if ($result['message']) {
notice($result['message']);
}
$a->redirect($return_url);
$a->internalRedirect($return_url);
} elseif ($result['cid']) {
$a->redirect('contact/' . $result['cid']);
$a->internalRedirect('contact/' . $result['cid']);
}
info(L10n::t('The contact could not be added.'));
$a->redirect($return_url);
$a->internalRedirect($return_url);
// NOTREACHED
}
@ -54,7 +54,7 @@ function follow_content(App $a)
if (!local_user()) {
notice(L10n::t('Permission denied.'));
$a->redirect($return_url);
$a->internalRedirect($return_url);
// NOTREACHED
}
@ -74,7 +74,7 @@ function follow_content(App $a)
if ($r[0]['pending']) {
notice(L10n::t('You already added this contact.'));
$submit = '';
//$a->redirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_url']);
// NOTREACHED
}
}
@ -84,21 +84,21 @@ function follow_content(App $a)
if (($ret['network'] == Protocol::DIASPORA) && !Config::get('system', 'diaspora_enabled')) {
notice(L10n::t("Diaspora support isn't enabled. Contact can't be added."));
$submit = '';
//$a->redirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_url']);
// NOTREACHED
}
if (($ret['network'] == Protocol::OSTATUS) && Config::get('system', 'ostatus_disabled')) {
notice(L10n::t("OStatus support is disabled. Contact can't be added."));
$submit = '';
//$a->redirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_url']);
// NOTREACHED
}
if ($ret['network'] == Protocol::PHANTOM) {
notice(L10n::t("The network type couldn't be detected. Contact can't be added."));
$submit = '';
//$a->redirect($_SESSION['return_url']);
//$a->internalRedirect($_SESSION['return_url']);
// NOTREACHED
}
@ -118,7 +118,7 @@ function follow_content(App $a)
if (!$r) {
notice(L10n::t('Permission denied.'));
$a->redirect($return_url);
$a->internalRedirect($return_url);
// NOTREACHED
}