ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilUserAutoComplete Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilUserAutoComplete:
+ Collaboration diagram for ilUserAutoComplete:

Public Member Functions

 __construct ()
 
 respectMinimumSearchCharacterCount (bool $a_status)
 
 getRespectMinimumSearchCharacterCount ()
 
 addUserAccessFilterCallable (Closure $user_filter)
 Closure for filtering users e.g $rep_search_gui->addUserAccessFilterCallable(function($user_ids) use($ref_id,$rbac_perm,$pos_perm)) { // filter users return $filtered_users }. More...
 
 setLimit (int $a_limit)
 
 getLimit ()
 
 setSearchType (int $search_type)
 
 getSearchType ()
 
 setPrivacyMode (int $privacy_mode)
 
 getPrivacyMode ()
 
 setUser (ilObjUser $user)
 
 getUser ()
 
 enableFieldSearchableCheck (bool $a_status)
 Enable the check whether the field is searchable in Administration -> Settings -> Standard Fields. More...
 
 isFieldSearchableCheckEnabled ()
 
 enableUserAccessCheck (bool $a_status)
 Enable user access check. More...
 
 isUserAccessCheckEnabled ()
 Check if user access check is enabled. More...
 
 setSearchFields (array $a_fields)
 Set searchable fields. More...
 
 getSearchFields ()
 get possible search fields More...
 
 setResultField (string $a_field)
 Set result field. More...
 
 getList (string $a_str)
 Get completion list. More...
 
 setUserLimitations (bool $a_limitations)
 allow user limitations like inactive and access limitations More...
 
 getUserLimitations ()
 allow user limitations like inactive and access limitations More...
 
 isMoreLinkAvailable ()
 
 setMoreLinkAvailable (bool $more_link_available)
 IMPORTANT: remember to read request parameter 'fetchall' to use this function. More...
 
 parseQueryString (string $a_query)
 Parse query string. More...
 

Data Fields

const MAX_ENTRIES = 1000
 
const SEARCH_TYPE_LIKE = 1
 
const SEARCH_TYPE_EQUALS = 2
 
const PRIVACY_MODE_RESPECT_USER_SETTING = 1
 
const PRIVACY_MODE_IGNORE_USER_SETTING = 2
 

Protected Member Functions

 getFields ()
 Get searchable fields. More...
 
 getSelectPart ()
 
 getFromPart ()
 
 getWherePart (array $search_query)
 
 getOrderByPart ()
 
 getQueryConditionByFieldAndValue (string $field, array $query)
 

Protected Attributes

Closure $user_filter = null
 

Private Attributes

ilLogger $logger = null
 
bool $searchable_check = false
 
bool $user_access_check = true
 
array $possible_fields = array()
 
string $result_field
 
int $search_type
 
int $privacy_mode
 
ilObjUser $user = null
 
int $limit = 0
 
bool $user_limitations = true
 
bool $respect_min_search_character_count = true
 
bool $more_link_available = false
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Auto completion class for user lists

Definition at line 22 of file class.ilUserAutoComplete.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserAutoComplete::__construct ( )

Definition at line 44 of file class.ilUserAutoComplete.php.

References $DIC, ILIAS\Repository\logger(), setPrivacyMode(), and setSearchType().

45  {
46  global $DIC;
47 
48  $this->result_field = 'login';
49 
50  $this->setSearchType(self::SEARCH_TYPE_LIKE);
51  $this->setPrivacyMode(self::PRIVACY_MODE_IGNORE_USER_SETTING);
52 
53  $this->logger = $DIC->logger()->user();
54  }
setPrivacyMode(int $privacy_mode)
setSearchType(int $search_type)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ addUserAccessFilterCallable()

ilUserAutoComplete::addUserAccessFilterCallable ( Closure  $user_filter)

Closure for filtering users e.g $rep_search_gui->addUserAccessFilterCallable(function($user_ids) use($ref_id,$rbac_perm,$pos_perm)) { // filter users return $filtered_users }.

Definition at line 74 of file class.ilUserAutoComplete.php.

References $user_filter.

74  : void
75  {
76  $this->user_filter = $user_filter;
77  }

◆ enableFieldSearchableCheck()

ilUserAutoComplete::enableFieldSearchableCheck ( bool  $a_status)

Enable the check whether the field is searchable in Administration -> Settings -> Standard Fields.

Definition at line 122 of file class.ilUserAutoComplete.php.

122  : void
123  {
124  $this->searchable_check = $a_status;
125  }

◆ enableUserAccessCheck()

ilUserAutoComplete::enableUserAccessCheck ( bool  $a_status)

Enable user access check.

See also
Administration -> User Accounts -> Settings -> General Settings

Definition at line 136 of file class.ilUserAutoComplete.php.

136  : void
137  {
138  $this->user_access_check = $a_status;
139  }

◆ getFields()

ilUserAutoComplete::getFields ( )
protected

Get searchable fields.

Definition at line 168 of file class.ilUserAutoComplete.php.

References ilUserSearchOptions\_isEnabled(), getSearchFields(), and isFieldSearchableCheckEnabled().

Referenced by getWherePart().

168  : array // Missing array type.
169  {
170  if (!$this->isFieldSearchableCheckEnabled()) {
171  return $this->getSearchFields();
172  }
173  $available_fields = array();
174  foreach ($this->getSearchFields() as $field) {
175  if (ilUserSearchOptions::_isEnabled($field)) {
176  $available_fields[] = $field;
177  }
178  }
179  return $available_fields;
180  }
getSearchFields()
get possible search fields
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFromPart()

ilUserAutoComplete::getFromPart ( )
protected

Definition at line 303 of file class.ilUserAutoComplete.php.

References $DIC, $ilDB, and getPrivacyMode().

Referenced by getList().

303  : string
304  {
305  global $DIC;
306 
307  $ilDB = $DIC->database();
308 
309  $joins = array();
310 
311  if (self::PRIVACY_MODE_RESPECT_USER_SETTING == $this->getPrivacyMode()) {
312  $joins[] = 'LEFT JOIN usr_pref profpref
313  ON profpref.usr_id = ud.usr_id
314  AND profpref.keyword = ' . $ilDB->quote('public_profile', 'text');
315 
316  $joins[] = 'LEFT JOIN usr_pref pubemail
317  ON pubemail.usr_id = ud.usr_id
318  AND pubemail.keyword = ' . $ilDB->quote('public_email', 'text');
319 
320  $joins[] = 'LEFT JOIN usr_pref pubsecondemail
321  ON pubsecondemail.usr_id = ud.usr_id
322  AND pubsecondemail.keyword = ' . $ilDB->quote('public_second_email', 'text');
323  }
324 
325  if ($joins) {
326  return 'usr_data ud ' . implode(' ', $joins);
327  } else {
328  return 'usr_data ud';
329  }
330  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLimit()

ilUserAutoComplete::getLimit ( )

Definition at line 84 of file class.ilUserAutoComplete.php.

References $limit.

Referenced by getList().

84  : int
85  {
86  return $this->limit;
87  }
+ Here is the caller graph for this function:

◆ getList()

ilUserAutoComplete::getList ( string  $a_str)

Get completion list.

Definition at line 193 of file class.ilUserAutoComplete.php.

References $DIC, $ilDB, $query, $res, ilUserSearchOptions\_isEnabled(), ilLogLevel\DEBUG, getFromPart(), ilSearchSettings\getInstance(), getLimit(), getOrderByPart(), getPrivacyMode(), getSelectPart(), getWherePart(), isFieldSearchableCheckEnabled(), isMoreLinkAvailable(), ILIAS\Repository\logger(), ilQueryParser\MIN_WORD_LENGTH, parseQueryString(), and ilStr\strLen().

193  : string
194  {
195  global $DIC;
196  $ilDB = $DIC->database();
197 
198  $parsed_query = $this->parseQueryString($a_str);
199 
200  if (ilStr::strLen($parsed_query['query']) < ilQueryParser::MIN_WORD_LENGTH) {
201  $result_json['items'] = [];
202  $result_json['hasMoreResults'] = false;
203  $this->logger->debug('Autocomplete search rejected: minimum characters count.');
204  return json_encode($result_json);
205  }
206 
207 
208  $select_part = $this->getSelectPart();
209  $where_part = $this->getWherePart($parsed_query);
210  $order_by_part = $this->getOrderByPart();
211  $query = implode(" ", array(
212  'SELECT ' . $select_part,
213  'FROM ' . $this->getFromPart(),
214  $where_part ? 'WHERE ' . $where_part : '',
215  $order_by_part ? 'ORDER BY ' . $order_by_part : ''
216  ));
217 
218  $this->logger->debug('Query: ' . $query);
219 
220  $res = $ilDB->query($query);
221 
222  // add email only if it is "searchable"
223  $add_email = true;
225  $add_email = false;
226  }
227 
228  $add_second_email = true;
229  if ($this->isFieldSearchableCheckEnabled() && !ilUserSearchOptions::_isEnabled("second_email")) {
230  $add_second_email = false;
231  }
232 
233  $max = $this->getLimit() ?: ilSearchSettings::getInstance()->getAutoCompleteLength();
234  $cnt = 0;
235  $more_results = false;
236  $result = array();
237  $recs = array();
238  $usrIds = array();
239  while (($rec = $ilDB->fetchAssoc($res)) && $cnt < ($max + 1)) {
240  if ($cnt >= $max && $this->isMoreLinkAvailable()) {
241  $more_results = true;
242  break;
243  }
244  $recs[$rec['usr_id']] = $rec;
245  $usrIds[] = $rec['usr_id'];
246  $cnt++;
247  }
248  $callable_name = null;
249  if (is_callable($this->user_filter, true, $callable_name)) {
250  $usrIds = call_user_func($this->user_filter, $usrIds);
251  }
252  foreach ($usrIds as $usr_id) {
253  $rec = $recs[$usr_id];
254 
255  if (self::PRIVACY_MODE_RESPECT_USER_SETTING != $this->getPrivacyMode() || in_array($rec['profile_value'], ['y','g'])) {
256  $label = $rec['lastname'] . ', ' . $rec['firstname'] . ' [' . $rec['login'] . ']';
257  } else {
258  $label = '[' . $rec['login'] . ']';
259  }
260 
261  if ($add_email && $rec['email'] && (self::PRIVACY_MODE_RESPECT_USER_SETTING != $this->getPrivacyMode() || 'y' == $rec['email_value'])) {
262  $label .= ', ' . $rec['email'];
263  }
264 
265  if ($add_second_email && $rec['second_email'] && (self::PRIVACY_MODE_RESPECT_USER_SETTING != $this->getPrivacyMode() || 'y' == $rec['second_email_value'])) {
266  $label .= ', ' . $rec['second_email'];
267  }
268 
269  $result[$cnt]['value'] = (string) $rec[$this->result_field];
270  $result[$cnt]['label'] = $label;
271  $result[$cnt]['id'] = $rec['usr_id'];
272  $cnt++;
273  }
274 
275  $result_json['items'] = $result;
276  $result_json['hasMoreResults'] = $more_results;
277 
278  $this->logger->dump($result_json, ilLogLevel::DEBUG);
279 
280  return json_encode($result_json, JSON_THROW_ON_ERROR);
281  }
$res
Definition: ltiservices.php:69
getWherePart(array $search_query)
parseQueryString(string $a_query)
Parse query string.
global $DIC
Definition: feed.php:28
static strLen(string $a_string)
Definition: class.ilStr.php:63
const MIN_WORD_LENGTH
Minimum of characters required for search.
$query
+ Here is the call graph for this function:

◆ getOrderByPart()

ilUserAutoComplete::getOrderByPart ( )
protected

Definition at line 427 of file class.ilUserAutoComplete.php.

Referenced by getList().

427  : string
428  {
429  return 'login ASC';
430  }
+ Here is the caller graph for this function:

◆ getPrivacyMode()

ilUserAutoComplete::getPrivacyMode ( )

Definition at line 104 of file class.ilUserAutoComplete.php.

References $privacy_mode.

Referenced by getFromPart(), getList(), getSelectPart(), and getWherePart().

104  : int
105  {
106  return $this->privacy_mode;
107  }
+ Here is the caller graph for this function:

◆ getQueryConditionByFieldAndValue()

ilUserAutoComplete::getQueryConditionByFieldAndValue ( string  $field,
array  $query 
)
protected

Definition at line 432 of file class.ilUserAutoComplete.php.

References $DIC, $ilDB, and getSearchType().

Referenced by getWherePart().

432  : string // Missing array type.
433  {
434  global $DIC;
435 
436  $ilDB = $DIC->database();
437 
438  $query_strings = array($query['query']);
439 
440  if (array_key_exists($field, $query)) {
441  $query_strings = array($query[$field]);
442  } elseif (array_key_exists('parts', $query)) {
443  $query_strings = $query['parts'];
444  }
445 
446  $query_condition = '( ';
447  $num = 0;
448  foreach ($query_strings as $query_string) {
449  if ($num++ > 0) {
450  $query_condition .= ' OR ';
451  }
452  if (self::SEARCH_TYPE_LIKE == $this->getSearchType()) {
453  $query_condition .= $ilDB->like($field, 'text', $query_string . '%');
454  } else {
455  $query_condition .= $ilDB->like($field, 'text', $query_string);
456  }
457  }
458  $query_condition .= ')';
459  return $query_condition;
460  }
global $DIC
Definition: feed.php:28
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRespectMinimumSearchCharacterCount()

ilUserAutoComplete::getRespectMinimumSearchCharacterCount ( )

Definition at line 61 of file class.ilUserAutoComplete.php.

References $respect_min_search_character_count.

61  : bool
62  {
64  }

◆ getSearchFields()

ilUserAutoComplete::getSearchFields ( )

get possible search fields

Definition at line 160 of file class.ilUserAutoComplete.php.

References $possible_fields.

Referenced by getFields().

160  : array // Missing array type.
161  {
162  return $this->possible_fields;
163  }
+ Here is the caller graph for this function:

◆ getSearchType()

ilUserAutoComplete::getSearchType ( )

Definition at line 94 of file class.ilUserAutoComplete.php.

References $search_type.

Referenced by getQueryConditionByFieldAndValue().

94  : int
95  {
96  return $this->search_type;
97  }
+ Here is the caller graph for this function:

◆ getSelectPart()

ilUserAutoComplete::getSelectPart ( )
protected

Definition at line 283 of file class.ilUserAutoComplete.php.

References getPrivacyMode().

Referenced by getList().

283  : string
284  {
285  $fields = array(
286  'ud.usr_id',
287  'ud.login',
288  'ud.firstname',
289  'ud.lastname',
290  'ud.email',
291  'ud.second_email'
292  );
293 
294  if (self::PRIVACY_MODE_RESPECT_USER_SETTING == $this->getPrivacyMode()) {
295  $fields[] = 'profpref.value profile_value';
296  $fields[] = 'pubemail.value email_value';
297  $fields[] = 'pubsecondemail.value second_email_value';
298  }
299 
300  return implode(', ', $fields);
301  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUser()

ilUserAutoComplete::getUser ( )

Definition at line 114 of file class.ilUserAutoComplete.php.

References $user.

Referenced by ilOnScreenChatUserUserAutoComplete\getWherePart(), and getWherePart().

114  : ?ilObjUser
115  {
116  return $this->user;
117  }
+ Here is the caller graph for this function:

◆ getUserLimitations()

ilUserAutoComplete::getUserLimitations ( )

allow user limitations like inactive and access limitations

Definition at line 473 of file class.ilUserAutoComplete.php.

References $user_limitations.

Referenced by getWherePart().

473  : bool
474  {
476  }
+ Here is the caller graph for this function:

◆ getWherePart()

ilUserAutoComplete::getWherePart ( array  $search_query)
protected

Definition at line 332 of file class.ilUserAutoComplete.php.

References $DIC, $ilDB, $ilSetting, ILIAS\LTI\ToolProvider\$settings, ANONYMOUS_USER_ID, getFields(), ilUserFilter\getInstance(), ilUserAccountSettings\getInstance(), ilSearchSettings\getInstance(), getPrivacyMode(), getQueryConditionByFieldAndValue(), getUser(), and getUserLimitations().

Referenced by getList().

332  : string // Missing array type.
333  {
334  global $DIC;
335 
336  $ilDB = $DIC->database();
337  $ilSetting = $DIC->settings();
338 
339  $outer_conditions = array();
340 
341  // In 'anonymous' context with respected user privacy, only users with globally published profiles should be found.
342  if (self::PRIVACY_MODE_RESPECT_USER_SETTING == $this->getPrivacyMode() &&
343  $this->getUser() instanceof ilObjUser &&
344  $this->getUser()->isAnonymous()
345  ) {
346  if (!$ilSetting->get('enable_global_profiles', '0')) {
347  // If 'Enable User Content Publishing' is not set in the administration, no user should be found for 'anonymous' context.
348  return '1 = 2';
349  } else {
350  // Otherwise respect the profile activation setting of every user (as a global (outer) condition in the where clause).
351  $outer_conditions[] = 'profpref.value = ' . $ilDB->quote('g', 'text');
352  }
353  }
354 
355  $outer_conditions[] = 'ud.usr_id != ' . $ilDB->quote(ANONYMOUS_USER_ID, 'integer');
356 
357  $field_conditions = array();
358  foreach ($this->getFields() as $field) {
359  $field_condition = $this->getQueryConditionByFieldAndValue($field, $search_query);
360 
361  if ('email' == $field && self::PRIVACY_MODE_RESPECT_USER_SETTING == $this->getPrivacyMode()) {
362  // If privacy should be respected, the profile setting of every user concerning the email address has to be
363  // respected (in every user context, no matter if the user is 'logged in' or 'anonymous').
364  $email_query = array();
365  $email_query[] = $field_condition;
366  $email_query[] = 'pubemail.value = ' . $ilDB->quote('y', 'text');
367  $field_conditions[] = '(' . implode(' AND ', $email_query) . ')';
368  } elseif ('second_email' == $field && self::PRIVACY_MODE_RESPECT_USER_SETTING == $this->getPrivacyMode()) {
369  // If privacy should be respected, the profile setting of every user concerning the email address has to be
370  // respected (in every user context, no matter if the user is 'logged in' or 'anonymous').
371  $email_query = array();
372  $email_query[] = $field_condition;
373  $email_query[] = 'pubsecondemail.value = ' . $ilDB->quote('y', 'text');
374  $field_conditions[] = '(' . implode(' AND ', $email_query) . ')';
375  } else {
376  $field_conditions[] = $field_condition;
377  }
378  }
379 
380  // If the current user context ist 'logged in' and privacy should be respected, all fields >>>except the login<<<
381  // should only be searchable if the users' profile is published (y oder g)
382  // In 'anonymous' context we do not need this additional conditions,
383  // because we checked the privacy setting in the condition above: profile = 'g'
384  if (self::PRIVACY_MODE_RESPECT_USER_SETTING == $this->getPrivacyMode() &&
385  $this->getUser() instanceof ilObjUser && !$this->getUser()->isAnonymous() &&
386  $field_conditions
387  ) {
388  $fields = '(' . implode(' OR ', $field_conditions) . ')';
389 
390  $field_conditions = [
391  '(' . implode(' AND ', array(
392  $fields,
393  $ilDB->in('profpref.value', array('y', 'g'), false, 'text')
394  )) . ')'
395  ];
396  }
397 
398  // The login field must be searchable regardless (for 'logged in' users) of any privacy settings.
399  // We handled the general condition for 'anonymous' context above: profile = 'g'
400  $field_conditions[] = $this->getQueryConditionByFieldAndValue('login', $search_query);
401 
402  if (ilUserAccountSettings::getInstance()->isUserAccessRestricted()) {
403  $outer_conditions[] = $ilDB->in('time_limit_owner', ilUserFilter::getInstance()->getFolderIds(), false, 'integer');
404  }
405 
406  if ($field_conditions) {
407  $outer_conditions[] = '(' . implode(' OR ', $field_conditions) . ')';
408  }
409 
411 
412  if (!$settings->isInactiveUserVisible() && $this->getUserLimitations()) {
413  $outer_conditions[] = "ud.active = " . $ilDB->quote(1, 'integer');
414  }
415 
416  if (!$settings->isLimitedUserVisible() && $this->getUserLimitations()) {
417  $unlimited = "ud.time_limit_unlimited = " . $ilDB->quote(1, 'integer');
418  $from = "ud.time_limit_from < " . $ilDB->quote(time(), 'integer');
419  $until = "ud.time_limit_until > " . $ilDB->quote(time(), 'integer');
420 
421  $outer_conditions[] = '(' . $unlimited . ' OR (' . $from . ' AND ' . $until . '))';
422  }
423 
424  return implode(' AND ', $outer_conditions);
425  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: feed.php:28
getFields()
Get searchable fields.
getUserLimitations()
allow user limitations like inactive and access limitations
global $ilSetting
Definition: privfeed.php:17
getQueryConditionByFieldAndValue(string $field, array $query)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isFieldSearchableCheckEnabled()

ilUserAutoComplete::isFieldSearchableCheckEnabled ( )

Definition at line 127 of file class.ilUserAutoComplete.php.

References $searchable_check.

Referenced by getFields(), and getList().

127  : bool
128  {
130  }
+ Here is the caller graph for this function:

◆ isMoreLinkAvailable()

ilUserAutoComplete::isMoreLinkAvailable ( )

Definition at line 478 of file class.ilUserAutoComplete.php.

References $more_link_available.

Referenced by getList().

478  : bool
479  {
481  }
+ Here is the caller graph for this function:

◆ isUserAccessCheckEnabled()

ilUserAutoComplete::isUserAccessCheckEnabled ( )

Check if user access check is enabled.

Definition at line 144 of file class.ilUserAutoComplete.php.

References $user_access_check.

144  : bool
145  {
147  }

◆ parseQueryString()

ilUserAutoComplete::parseQueryString ( string  $a_query)

Parse query string.

Definition at line 494 of file class.ilUserAutoComplete.php.

References $query, ilLogLevel\DEBUG, and ILIAS\Repository\logger().

Referenced by getList().

494  : array // Missing array type.
495  {
496  $query = array();
497 
498  if (strpos($a_query, '\\') === false) {
499  $a_query = str_replace(['%', '_'], ['\%', '\_'], $a_query);
500  }
501 
502  $query['query'] = trim($a_query);
503 
504  // "," means fixed search for lastname, firstname
505  if (strpos($a_query, ',')) {
506  $comma_separated = explode(',', $a_query);
507 
508  if (count($comma_separated) == 2) {
509  if (trim($comma_separated[0])) {
510  $query['lastname'] = trim($comma_separated[0]);
511  }
512  if (trim($comma_separated[1])) {
513  $query['firstname'] = trim($comma_separated[1]);
514  }
515  }
516  } else {
517  $whitespace_separated = explode(' ', $a_query);
518  foreach ($whitespace_separated as $part) {
519  if (trim($part)) {
520  $query['parts'][] = trim($part);
521  }
522  }
523  }
524 
525  $this->logger->dump($query, ilLogLevel::DEBUG);
526 
527  return $query;
528  }
$query
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ respectMinimumSearchCharacterCount()

ilUserAutoComplete::respectMinimumSearchCharacterCount ( bool  $a_status)

Definition at line 56 of file class.ilUserAutoComplete.php.

56  : void
57  {
58  $this->respect_min_search_character_count = $a_status;
59  }

◆ setLimit()

ilUserAutoComplete::setLimit ( int  $a_limit)

Definition at line 79 of file class.ilUserAutoComplete.php.

79  : void
80  {
81  $this->limit = $a_limit;
82  }

◆ setMoreLinkAvailable()

ilUserAutoComplete::setMoreLinkAvailable ( bool  $more_link_available)

IMPORTANT: remember to read request parameter 'fetchall' to use this function.

Definition at line 486 of file class.ilUserAutoComplete.php.

References $more_link_available.

486  : void
487  {
488  $this->more_link_available = $more_link_available;
489  }

◆ setPrivacyMode()

ilUserAutoComplete::setPrivacyMode ( int  $privacy_mode)

Definition at line 99 of file class.ilUserAutoComplete.php.

References $privacy_mode.

Referenced by __construct().

99  : void
100  {
101  $this->privacy_mode = $privacy_mode;
102  }
+ Here is the caller graph for this function:

◆ setResultField()

ilUserAutoComplete::setResultField ( string  $a_field)

Set result field.

Definition at line 185 of file class.ilUserAutoComplete.php.

185  : void
186  {
187  $this->result_field = $a_field;
188  }

◆ setSearchFields()

ilUserAutoComplete::setSearchFields ( array  $a_fields)

Set searchable fields.

Definition at line 152 of file class.ilUserAutoComplete.php.

Referenced by ilCmiXapiStatementsGUI\asyncUserAutocompleteCmd(), ilLTIConsumerXapiStatementsGUI\asyncUserAutocompleteCmd(), and ilLTIConsumerGradeSynchronizationGUI\asyncUserAutocompleteCmd().

152  : void // Missing array type.
153  {
154  $this->possible_fields = $a_fields;
155  }
+ Here is the caller graph for this function:

◆ setSearchType()

ilUserAutoComplete::setSearchType ( int  $search_type)

Definition at line 89 of file class.ilUserAutoComplete.php.

References $search_type.

Referenced by __construct().

89  : void
90  {
91  $this->search_type = $search_type;
92  }
+ Here is the caller graph for this function:

◆ setUser()

ilUserAutoComplete::setUser ( ilObjUser  $user)

Definition at line 109 of file class.ilUserAutoComplete.php.

References $user, and ILIAS\Repository\user().

109  : void
110  {
111  $this->user = $user;
112  }
+ Here is the call graph for this function:

◆ setUserLimitations()

ilUserAutoComplete::setUserLimitations ( bool  $a_limitations)

allow user limitations like inactive and access limitations

Definition at line 465 of file class.ilUserAutoComplete.php.

465  : void
466  {
467  $this->user_limitations = $a_limitations;
468  }

Field Documentation

◆ $limit

int ilUserAutoComplete::$limit = 0
private

Definition at line 38 of file class.ilUserAutoComplete.php.

Referenced by getLimit().

◆ $logger

ilLogger ilUserAutoComplete::$logger = null
private

Definition at line 30 of file class.ilUserAutoComplete.php.

◆ $more_link_available

bool ilUserAutoComplete::$more_link_available = false
private

Definition at line 41 of file class.ilUserAutoComplete.php.

Referenced by isMoreLinkAvailable(), and setMoreLinkAvailable().

◆ $possible_fields

array ilUserAutoComplete::$possible_fields = array()
private

Definition at line 33 of file class.ilUserAutoComplete.php.

Referenced by getSearchFields().

◆ $privacy_mode

int ilUserAutoComplete::$privacy_mode
private

Definition at line 36 of file class.ilUserAutoComplete.php.

Referenced by getPrivacyMode(), and setPrivacyMode().

◆ $respect_min_search_character_count

bool ilUserAutoComplete::$respect_min_search_character_count = true
private

Definition at line 40 of file class.ilUserAutoComplete.php.

Referenced by getRespectMinimumSearchCharacterCount().

◆ $result_field

string ilUserAutoComplete::$result_field
private

Definition at line 34 of file class.ilUserAutoComplete.php.

◆ $search_type

int ilUserAutoComplete::$search_type
private

Definition at line 35 of file class.ilUserAutoComplete.php.

Referenced by getSearchType(), and setSearchType().

◆ $searchable_check

bool ilUserAutoComplete::$searchable_check = false
private

Definition at line 31 of file class.ilUserAutoComplete.php.

Referenced by isFieldSearchableCheckEnabled().

◆ $user

ilObjUser ilUserAutoComplete::$user = null
private

Definition at line 37 of file class.ilUserAutoComplete.php.

Referenced by getUser(), and setUser().

◆ $user_access_check

bool ilUserAutoComplete::$user_access_check = true
private

Definition at line 32 of file class.ilUserAutoComplete.php.

Referenced by isUserAccessCheckEnabled().

◆ $user_filter

Closure ilUserAutoComplete::$user_filter = null
protected

Definition at line 42 of file class.ilUserAutoComplete.php.

Referenced by addUserAccessFilterCallable().

◆ $user_limitations

bool ilUserAutoComplete::$user_limitations = true
private

Definition at line 39 of file class.ilUserAutoComplete.php.

Referenced by getUserLimitations().

◆ MAX_ENTRIES

◆ PRIVACY_MODE_IGNORE_USER_SETTING

const ilUserAutoComplete::PRIVACY_MODE_IGNORE_USER_SETTING = 2

Definition at line 28 of file class.ilUserAutoComplete.php.

Referenced by ilObjEmployeeTalkGUI\executeCommand().

◆ PRIVACY_MODE_RESPECT_USER_SETTING

◆ SEARCH_TYPE_EQUALS

const ilUserAutoComplete::SEARCH_TYPE_EQUALS = 2

◆ SEARCH_TYPE_LIKE

const ilUserAutoComplete::SEARCH_TYPE_LIKE = 1

Definition at line 25 of file class.ilUserAutoComplete.php.


The documentation for this class was generated from the following file: