+ $session = DI::session();
+
+ $session->set('remote', []);
+
+ $remote_contacts = DBA::select('contact', ['id', 'uid'], ['nurl' => Strings::normaliseLink($session->get('my_url')), 'rel' => [Contact::FOLLOWER, Contact::FRIEND], 'self' => false]);
+ while ($contact = DBA::fetch($remote_contacts)) {
+ if (($contact['uid'] == 0) || Contact\User::isBlocked($contact['id'], $contact['uid'])) {
+ continue;
+ }
+
+ $session->set('remote', [$contact['uid'] => $contact['id']]);
+ }
+ DBA::close($remote_contacts);
+ }
+
+ /**
+ * Returns if the current visitor is authenticated
+ *
+ * @return boolean "true" when visitor is either a local or remote user
+ */
+ public static function isAuthenticated()
+ {
+ $session = DI::session();
+
+ return $session->get('authenticated', false);