X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fredir.php;h=e96a58b63a965f50ef70016481be5b38c46f3571;hb=3d65809a82b5c357887f5b98ab722464a74ee828;hp=2f97911dc3c9662385e5d83d9016897ce17eaab7;hpb=4dc6b290461f0bbbf8183eb572fadfc06d6bedd7;p=friendica.git diff --git a/mod/redir.php b/mod/redir.php index 2f97911dc3..e96a58b63a 100644 --- a/mod/redir.php +++ b/mod/redir.php @@ -35,10 +35,9 @@ function redir_init(App $a) { } $url = $_GET['url'] ?? ''; - $quiet = !empty($_GET['quiet']) ? '&quiet=1' : ''; - if ($a->argc > 1 && intval($a->argv[1])) { - $cid = intval($a->argv[1]); + if (DI::args()->getArgc() > 1 && intval(DI::args()->getArgv()[1])) { + $cid = intval(DI::args()->getArgv()[1]); } else { $cid = 0; } @@ -58,7 +57,7 @@ function redir_init(App $a) { $contact_url = $contact['url']; - if (!empty($a->contact['id']) && $a->contact['id'] == $cid) { + if (!empty($a->getContactId()) && $a->getContactId() == $cid) { // Local user is already authenticated. redir_check_url($contact_url, $url); $a->redirect($url ?: $contact_url); @@ -73,11 +72,11 @@ function redir_init(App $a) { $cid = $contact['id']; } - if (!empty($a->contact['id']) && $a->contact['id'] == $cid) { + if (!empty($a->getContactId()) && $a->getContactId() == $cid) { // Local user is already authenticated. redir_check_url($contact_url, $url); $target_url = $url ?: $contact_url; - Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); + Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url); $a->redirect($target_url); } } @@ -94,7 +93,7 @@ function redir_init(App $a) { // Remote user is already authenticated. redir_check_url($contact_url, $url); $target_url = $url ?: $contact_url; - Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG); + Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url); $a->redirect($target_url); } } @@ -113,7 +112,7 @@ function redir_init(App $a) { $url .= $separator . 'zrl=' . urlencode($my_profile); } - Logger::log('redirecting to ' . $url, Logger::DEBUG); + Logger::info('redirecting to ' . $url); $a->redirect($url); } @@ -143,7 +142,7 @@ function redir_magic($a, $cid, $url) } // Test for magic auth on the target system - $serverret = DI::httpRequest()->get($basepath . '/magic'); + $serverret = DI::httpClient()->get($basepath . '/magic'); if ($serverret->isSuccess()) { $separator = strpos($target_url, '?') ? '&' : '?'; $target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);