Renamed System::redirect() to $a->redirect()

This commit is contained in:
Philipp Holzer 2018-10-13 20:02:04 +02:00
parent c46caeb0d3
commit 2ef81108b3
No known key found for this signature in database
GPG key ID: 517BE60E2CE5C8A5
62 changed files with 269 additions and 253 deletions

View file

@ -1639,7 +1639,7 @@ class Contact extends BaseObject
$myaddr = bin2hex($a->user['nickname'] . '@' . $a->getHostName());
}
goaway($ret['request'] . "&addr=$myaddr");
$a->redirect($ret['request'] . "&addr=$myaddr");
// NOTREACHED
}

View file

@ -1047,7 +1047,7 @@ class Profile
// Try to avoid recursion - but send them home to do a proper magic auth.
$query = str_replace(array('?zrl=', '&zid='), array('?rzrl=', '&rzrl='), $a->query_string);
// The other instance needs to know where to redirect.
$dest = urlencode(System::baseUrl() . '/' . $query);
$dest = urlencode($a->getBaseURL() . '/' . $query);
// We need to extract the basebath from the profile url
// to redirect the visitors '/magic' module.
@ -1055,14 +1055,14 @@ class Profile
$urlarr = explode('/profile/', $contact['url']);
$basepath = $urlarr[0];
if ($basepath != System::baseUrl() && !strstr($dest, '/magic') && !strstr($dest, '/rmagic')) {
if ($basepath != $a->getBaseURL() && !strstr($dest, '/magic') && !strstr($dest, '/rmagic')) {
$magic_path = $basepath . '/magic' . '?f=&owa=1&dest=' . $dest;
// We have to check if the remote server does understand /magic without invoking something
$serverret = Network::curl($basepath . '/magic');
if ($serverret->isSuccess()) {
logger('Doing magic auth for visitor ' . $my_url . ' to ' . $magic_path, LOGGER_DEBUG);
goaway($magic_path);
$a->redirect($magic_path);
}
}
}

View file

@ -450,7 +450,7 @@ class User
} catch (Exception $e) {
throw new Exception(L10n::t('We encountered a problem while logging in with the OpenID you provided. Please check the correct spelling of the ID.') . EOL . EOL . L10n::t('The error message was:') . $e->getMessage(), 0, $e);
}
goaway($authurl);
$a->redirect($authurl);
// NOTREACHED
}
@ -783,6 +783,8 @@ class User
return;
}
$a = get_app();
logger('Removing user: ' . $uid);
$user = DBA::selectFirst('user', [], ['uid' => $uid]);
@ -807,7 +809,7 @@ class User
if ($uid == local_user()) {
unset($_SESSION['authenticated']);
unset($_SESSION['uid']);
goaway();;
$a->redirect();
}
}
}