4include_once 
'Services/User/classes/class.ilUserAutoComplete.php';
 
    5require_once 
'Services/Mail/classes/class.ilMailAutoCompleteRecipientProvider.php';
 
   27        $this->
data = $this->db->fetchAssoc($this->res);
 
   29        return is_array($this->
data);
 
   39            'login' => $this->
data[
'login'],
 
   40            'firstname' => $this->
data[
'firstname'],
 
   41            'lastname' => $this->
data[
'lastname']
 
   51        return $this->
data[
'login'];
 
   60            $this->db->free($this->res);
 
   66        $query = implode(
" ", array(
 
   67            'SELECT ' . $select_part,
 
   69            $where_part ? 
'WHERE ' . $where_part : 
'',
 
   70            $order_by_part ? 
'ORDER BY ' . $order_by_part : 
'' 
   73        $this->res = $this->db->query(
$query);
 
   84                "(CASE WHEN (profpref.value = %s OR profpref.value = %s) THEN firstname ELSE '' END) firstname",
 
   85                $this->db->quote(
'y', 
'text'),
 
   86                $this->db->quote(
'g', 
'text')
 
   89                "(CASE WHEN (profpref.value = %s OR profpref.value = %s) THEN lastname ELSE '' END) lastname",
 
   90                $this->db->quote(
'y', 
'text'),
 
   91                $this->db->quote(
'g', 
'text')
 
   94                "(CASE WHEN ((profpref.value = %s OR profpref.value = %s) AND pubemail.value = %s) THEN email ELSE '' END) email",
 
   95                $this->db->quote(
'y', 
'text'),
 
   96                $this->db->quote(
'g', 
'text'),
 
   97                $this->db->quote(
'y', 
'text')
 
  101        $fields[] = 
'profpref.value profile_value';
 
  102        $fields[] = 
'pubemail.value email_value';
 
  104        return implode(
', ', $fields);
 
  115                        LEFT JOIN usr_pref profpref 
  116                        ON profpref.usr_id = usr_data.usr_id 
  117                        AND profpref.keyword = ' . $this->db->quote(
'public_profile', 
'text');
 
  120                        LEFT JOIN usr_pref pubemail 
  121                        ON pubemail.usr_id = usr_data.usr_id 
  122                        AND pubemail.keyword = ' . $this->db->quote(
'public_email', 
'text');
 
  125            return 'usr_data ' . implode(
' ', $joins);
 
  137        $outer_conditions = array();
 
  138        $outer_conditions[] = 
'usr_data.usr_id != ' . $this->db->quote(ANONYMOUS_USER_ID, 
'integer');
 
  139        $outer_conditions[] = 
'usr_data.active != ' . $this->db->quote(0, 
'integer');
 
  141        $field_conditions = array();
 
  145            if (
'email' == $field) {
 
  148                $email_query = array();
 
  149                $email_query[] = $field_condition;
 
  150                $email_query[] = 
'pubemail.value = ' . $this->db->quote(
'y', 
'text');
 
  151                $field_conditions[] = 
'(' . implode(
' AND ', $email_query) . 
')';
 
  153                $field_conditions[] = $field_condition;
 
  161        if ($field_conditions) {
 
  162            $fields = 
'(' . implode(
' OR ', $field_conditions) . 
')';
 
  164            $field_conditions = [
'(' . implode(
' AND ', array(
 
  166                $this->db->in(
'profpref.value', array(
'y', 
'g'), 
false, 
'text')
 
  174        include_once 
'Services/User/classes/class.ilUserAccountSettings.php';
 
  176            include_once 
'./Services/User/classes/class.ilUserFilter.php';
 
  180        if ($field_conditions) {
 
  181            $outer_conditions[] = 
'(' . implode(
' OR ', $field_conditions) . 
')';
 
  184        return implode(
' AND ', $outer_conditions);
 
  202        return $this->db->like($field, 
'text', $a_str . 
'%');
 
  211        $available_fields = array();
 
  212        foreach (array(
'firstname', 
'lastname') as $field) {
 
  213            include_once 
'Services/Search/classes/class.ilUserSearchOptions.php';
 
  215                $available_fields[] = $field;
 
  218        return $available_fields;
 
An exception for terminatinating execution or to throw for unit testing.
Class ilMailAutoCompleteRecipientProvider.
Class ilMailAutoCompleteUserProvider.
getFields()
Get searchable fields.
rewind()
"Rewind "implementation of iterator interface
key()
"Key" implementation of iterator interface
getQueryConditionByFieldAndValue($field, $a_str)
current()
"Current" implementation of iterator interface
getWherePart($search_query)
__construct($quoted_term, $term)
valid()
"Valid" implementation of iterator interface
static getInstance()
Singelton get instance.
static getInstance()
Singelton get instance.
static _isEnabled($a_key)