Bugfixing redirects
- Adding App->redirect if both redirects are possible
This commit is contained in:
@@ -36,7 +36,7 @@ function redir_init(App $a) {
|
||||
|| (!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.
|
||||
{
|
||||
System::externalRedirect(defaults($url, $contact_url));
|
||||
$a->redirect(defaults($url, $contact_url));
|
||||
}
|
||||
|
||||
if ($contact['uid'] == 0 && local_user()) {
|
||||
@@ -52,7 +52,7 @@ function redir_init(App $a) {
|
||||
// Local user is already authenticated.
|
||||
$target_url = defaults($url, $contact_url);
|
||||
logger($contact['name'] . " is already authenticated. Redirecting to " . $target_url, LOGGER_DEBUG);
|
||||
System::externalRedirect($target_url);
|
||||
$a->redirect($target_url);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ function redir_init(App $a) {
|
||||
// Remote user is already authenticated.
|
||||
$target_url = defaults($url, $contact_url);
|
||||
logger($contact['name'] . " is already authenticated. Redirecting to " . $target_url, LOGGER_DEBUG);
|
||||
System::externalRedirect($target_url);
|
||||
$a->redirect($target_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ function redir_init(App $a) {
|
||||
}
|
||||
|
||||
logger('redirecting to ' . $url, LOGGER_DEBUG);
|
||||
System::externalRedirect($url);
|
||||
$a->redirect($url);
|
||||
}
|
||||
|
||||
notice(L10n::t('Contact not found.'));
|
||||
|
||||
Reference in New Issue
Block a user