src/Plugin/User.php
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;
	}
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;
	}
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 ; }
Returns the userinfo data for JFusion plugin based on the userid

@param Userinfo $exsistinginfo     user info

@return Userinfo|null returns user login info from the requester software or null
Returns the userinfo data for JFusion plugin based on the userid