- } elseif ($remote_user) {
- /*
- * Authenticated visitor. Unless pre-verified,
- * check that the contact belongs to this $owner_id
- * and load the groups the visitor belongs to.
- * If pre-verified, the caller is expected to have already
- * done this and passed the groups into this function.
- */
-
- if (!$remote_verified) {
- $cid = 0;
-
- foreach (\Friendica\Core\Session::get('remote', []) as $visitor) {
- if ($visitor['uid'] == $owner_id) {
- $cid = $visitor['cid'];
- break;
- }
- }
-
- if ($cid && DBA::exists('contact', ['id' => $cid, 'uid' => $owner_id, 'blocked' => false])) {
- $remote_verified = true;
- $groups = Group::getIdsByContactId($cid);
- }
- }