mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-17 04:15:15 +02:00
Fix "redir" loop
This commit is contained in:
parent
c0afa761ac
commit
5254147ccc
7 changed files with 93 additions and 39 deletions
15
boot.php
15
boot.php
|
@ -413,7 +413,7 @@ function public_contact()
|
|||
*
|
||||
* @return int|bool visitor_id or false
|
||||
*/
|
||||
function remote_user()
|
||||
function remote_user($uid = 0)
|
||||
{
|
||||
// You cannot be both local and remote.
|
||||
// Unncommented by rabuzarus because remote authentication to local
|
||||
|
@ -422,13 +422,22 @@ function remote_user()
|
|||
// return false;
|
||||
// }
|
||||
|
||||
if (empty($_SESSION)) {
|
||||
if (empty($_SESSION['authenticated'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['authenticated']) && !empty($_SESSION['visitor_id'])) {
|
||||
if (!empty($uid) && !empty($_SESSION['remote'])) {
|
||||
foreach ($_SESSION['remote'] as $visitor) {
|
||||
if ($visitor['uid'] == $uid) {
|
||||
return $visitor['cid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['visitor_id'])) {
|
||||
return intval($_SESSION['visitor_id']);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue