final public function lookupUser(Userinfo $exsistinginfo)
	{
		$user = null;
		if ($exsistinginfo) {
			//initialise some vars
			$db = Factory::getDBO();

			$query = $db->getQuery(true)
				->select('b.userid, b.username, b.email')
				->from('#__jfusion_users AS a')
				->innerJoin('#__jfusion_users AS b ON a.id = b.id')
				->where('b.jname = ' . $db->quote($this->getJname()))
				->where('a.jname = ' . $db->quote($exsistinginfo->getJname()));

			$search = array();
			if (isset($exsistinginfo->userid)) {
				$search[] = 'a.userid = ' . $db->quote($exsistinginfo->userid);
			}
			if (isset($exsistinginfo->username)) {
				$search[] = 'a.username = ' . $db->quote($exsistinginfo->username);
			}
			if (isset($exsistinginfo->email)) {
				$search[] = 'a.email = ' . $db->quote($exsistinginfo->email);
			}
			if (!empty($search)) {
				$query->where('( ' . implode(' OR ', $search) . ' )');
				$db->setQuery($query);
				$result = $db->loadObject();

				if ($result) {
					$user = new Userinfo($this->getJname());
					$user->bind($result);
				}
			}
		}
		return $user;
	}