+
+ /**
+ * Returns contact ID for given user ID
+ *
+ * @param integer $uid User ID
+ * @return integer Contact ID of visitor for given user ID
+ */
+ public static function getVisitorContactIDForUserID($uid)
+ {
+ if (empty($_SESSION['remote'][$uid])) {
+ return false;
+ }
+
+ return $_SESSION['remote'][$uid];
+ }
+
+ /**
+ * Returns User ID for given contact ID of the visitor
+ *
+ * @param integer $cid Contact ID
+ * @return integer User ID for given contact ID of the visitor
+ */
+ public static function getUserIDForVisitorContactID($cid)
+ {
+ if (empty($_SESSION['remote'])) {
+ return false;
+ }
+
+ return array_search($cid, $_SESSION['remote']);
+ }