- foreach($r as $rr) {
-
- // On a multi-user site, the query above *may* have returned two results.
- // One of those could be the logged-in user who is now visiting "this" cell,
- // as both share the dfrn_id. We will skip that entry if it unfortunately
- // happens to come up first.
-
- if(local_user() && ($rr['uid'] == get_uid()))
- continue;
-
- $s = fetch_url($rr['poll'] . '?dfrn_id=' . $dfrn_id . '&type=profile-check');
- if(strlen($s)) {
- $xml = simplexml_load_string($s);
- if((int) $xml->status == 1) {
- $_SESSION['authenticated'] = 1;
- $_SESSION['visitor_id'] = $rr['id'];
- notice( t('Hi ') . $rr['name'] . EOL);
- // Visitors get 1 day session.
- $session_id = session_id();
- $expire = time() + 86400;
- q("UPDATE `session` SET `expire` = '%s' WHERE `sid` = '%s' LIMIT 1",
- dbesc($expire),
- dbesc($session_id)
- );
- }
+
+ $s = fetch_url($r[0]['poll'] . '?dfrn_id=' . $my_id . '&type=profile-check');
+
+ if(strlen($s)) {
+
+ $xml = simplexml_load_string($s);
+
+ if((int) $xml->status == 1) {
+ $_SESSION['authenticated'] = 1;
+ $_SESSION['visitor_id'] = $r[0]['id'];
+ notice( t('Hi ') . $r[0]['name'] . EOL);
+ // Visitors get 1 day session.
+ $session_id = session_id();
+ $expire = time() + 86400;
+ q("UPDATE `session` SET `expire` = '%s' WHERE `sid` = '%s' LIMIT 1",
+ dbesc($expire),
+ dbesc($session_id)
+ );