/**
  * Do auto completion
  * @return void
  */
 protected function doUserAutoComplete()
 {
     if (!isset($_GET['autoCompleteField'])) {
         $a_fields = array('login', 'firstname', 'lastname', 'email');
         $result_field = 'login';
     } else {
         $a_fields = array((string) $_GET['autoCompleteField']);
         $result_field = (string) $_GET['autoCompleteField'];
     }
     include_once './Services/User/classes/class.ilUserAutoComplete.php';
     $auto = new ilUserAutoComplete();
     if ($_REQUEST['fetchall']) {
         $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
     }
     $auto->setSearchFields($a_fields);
     $auto->setResultField($result_field);
     $auto->enableFieldSearchableCheck(true);
     echo $auto->getList($_REQUEST['term']);
     exit;
 }