You probably don't want users being able to search email addresses so change this:
// ajax return all user events
$potentials = qa_db_read_all_assoc(
qa_db_query_sub(
'SELECT userid FROM ^users
WHERE `handle` LIKE #
LIMIT #',
'%'.$username.'%',
qa_opt('q2apro_ajax_usersearch_maxshow')
)
);
to this
// ajax return all user events
if ( qa_get_logged_in_level() >= QA_USER_LEVEL_ADMIN ) {
$potentials = qa_db_read_all_assoc(
qa_db_query_sub(
'SELECT userid FROM ^users
WHERE `email` LIKE #
LIMIT #',
'%'.$username.'%',
qa_opt('q2apro_ajax_usersearch_maxshow')
)
);
} else {
$potentials = qa_db_read_all_assoc(
qa_db_query_sub(
'SELECT userid FROM ^users
WHERE `handle` LIKE #
LIMIT #',
'%'.$username.'%',
qa_opt('q2apro_ajax_usersearch_maxshow')
)
);
}
As admin you will then be able to search by email address. Simply sign out to search by username.