/**
* Finds valid members matching the specified username prefix.
*
* @return XenForo_ControllerResponse_Abstract
*/
public function actionFind()
{
$q = ltrim($this->_input->filterSingle('q', XenForo_Input::STRING, array('noTrim' => true)));
if ($q !== '' && utf8_strlen($q) >= 2)
{
$users = $this->_getUserModel()->getUsers(
array(
'username' => array($q , 'r'),
'user_state' => 'valid',
'is_banned' => 0,
'active_recently' => true
),
array('limit' => 10)
);
}
else
{
$users = array();
}
$viewParams = array(
'users' => $users
);
return $this->responseView(
'XenForo_ViewPublic_Member_Find',
'member_autocomplete',
$viewParams
);
}