ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilUserQuery Class Reference

User query class. More...

+ Collaboration diagram for ilUserQuery:

Public Member Functions

 __construct ()
 Constructor. More...
 
 setUdfFilter ($a_val)
 Set udf filter. More...
 
 getUdfFilter ()
 Get udf filter. More...
 
 setOrderField ($a_order)
 Set order field (column in usr_data) Default order is 'login'. More...
 
 setOrderDirection ($a_dir)
 Set order direction 'asc' or 'desc' Default is 'asc'. More...
 
 setOffset ($a_offset)
 Set offset. More...
 
 setLimit ($a_limit)
 Set result limit Default is 50. More...
 
 setTextFilter ($a_filter)
 Text (like) filter in login, firstname, lastname or email. More...
 
 setActionFilter ($a_activation)
 Set activation filter 'active' or 'inactive' or empty. More...
 
 setLastLogin (ilDateTime $dt=null)
 Set last login filter. More...
 
 setLimitedAccessFilter ($a_status)
 Enable limited access filter. More...
 
 setNoCourseFilter ($a_no_course)
 Enable no course filter. More...
 
 setNoGroupFilter ($a_no_group)
 Enable no group filter. More...
 
 setCourseGroupFilter ($a_cg_id)
 Set course / group filter object_id of course or group. More...
 
 setRoleFilter ($a_role_id)
 Set role filter obj_id of role. More...
 
 setUserFolder ($a_fold_id)
 Set user folder filter reference id of user folder or category (local user administration) More...
 
 setAdditionalFields ($a_add)
 Set additional fields (columns in usr_data or 'online_time') More...
 
 setUserFilter ($a_filter)
 Array with user ids to query against. More...
 
 setFirstLetterLastname ($a_fll)
 set first letter lastname filter More...
 
 setAccessFilter ($a_access)
 set filter for user that are limited but has access More...
 
 setAuthenticationFilter ($a_authentication)
 Set authentication filter 'default', 'local' or 'lti'. More...
 
 query ()
 Query usr_data. More...
 

Static Public Member Functions

static getUserListData ( $a_order_field, $a_order_dir, $a_offset, $a_limit, $a_string_filter="", $a_activation_filter="", $a_last_login_filter=null, $a_limited_access_filter=false, $a_no_courses_filter=false, $a_course_group_filter=0, $a_role_filter=0, $a_user_folder_filter=null, $a_additional_fields='', $a_user_filter=null, $a_first_letter="", $a_authentication_filter=null)
 Get data for user administration list. More...
 

Data Fields

const DEFAULT_ORDER_FIELD = 'login'
 

Protected Attributes

 $udf_filter = array()
 

Private Attributes

 $logger = null
 
 $order_field = self::DEFAULT_ORDER_FIELD
 
 $order_dir = 'asc'
 
 $offset = 0
 
 $limit = 50
 
 $text_filter = ''
 
 $activation = ''
 
 $last_login = null
 
 $limited_access = false
 
 $no_courses = false
 
 $no_groups = false
 
 $crs_grp = 0
 
 $role = 0
 
 $user_folder = 0
 
 $additional_fields = array()
 
 $users = array()
 
 $first_letter = ''
 
 $has_access = false
 
 $authentication_method = ''
 
 $default_fields
 

Detailed Description

User query class.

Put any complex that queries for a set of users into this class and keep ilObjUser "small".

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilUserQuery.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserQuery::__construct ( )

Constructor.

Definition at line 62 of file class.ilUserQuery.php.

References $DIC.

63  {
64  global $DIC;
65 
66  $this->logger = $DIC->logger()->usr();
67  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ getUdfFilter()

ilUserQuery::getUdfFilter ( )

Get udf filter.

Returns
array udf filter array

Definition at line 93 of file class.ilUserQuery.php.

References $udf_filter.

Referenced by query().

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

◆ getUserListData()

static ilUserQuery::getUserListData (   $a_order_field,
  $a_order_dir,
  $a_offset,
  $a_limit,
  $a_string_filter = "",
  $a_activation_filter = "",
  $a_last_login_filter = null,
  $a_limited_access_filter = false,
  $a_no_courses_filter = false,
  $a_course_group_filter = 0,
  $a_role_filter = 0,
  $a_user_folder_filter = null,
  $a_additional_fields = '',
  $a_user_filter = null,
  $a_first_letter = "",
  $a_authentication_filter = null 
)
static

Get data for user administration list.

Deprecated:

Definition at line 581 of file class.ilUserQuery.php.

References $query.

Referenced by ilUserLPTableGUI\getItems(), ilAssignedUsersTableGUI\getItems(), ilLearningSequenceParticipantsTableGUI\parse(), ilGroupParticipantsTableGUI\parse(), ilCourseParticipantsTableGUI\parse(), ilSubscriberTableGUI\readSubscriberData(), and ilWaitingListTableGUI\readUserData().

598  {
599  $query = new ilUserQuery();
600  $query->setOrderField($a_order_field);
601  $query->setOrderDirection($a_order_dir);
602  $query->setOffset($a_offset);
603  $query->setLimit($a_limit);
604  $query->setTextFilter($a_string_filter);
605  $query->setActionFilter($a_activation_filter);
606  $query->setLastLogin($a_last_login_filter);
607  $query->setLimitedAccessFilter($a_limited_access_filter);
608  $query->setNoCourseFilter($a_no_courses_filter);
609  $query->setCourseGroupFilter($a_course_group_filter);
610  $query->setRoleFilter($a_role_filter);
611  $query->setUserFolder($a_user_folder_filter);
612  $query->setAdditionalFields($a_additional_fields);
613  $query->setUserFilter($a_user_filter);
614  $query->setFirstLetterLastname($a_first_letter);
615  $query->setAuthenticationFilter($a_authentication_filter);
616  return $query->query();
617  }
User query class.
$query
+ Here is the caller graph for this function:

◆ query()

ilUserQuery::query ( )

Query usr_data.

Returns
array ('cnt', 'set')

Definition at line 274 of file class.ilUserQuery.php.

References $DIC, $f, $from, $id, $ilDB, $limit, $offset, $query, $result, $row, ilDateTime\_before(), ilUserDefinedFields\_getInstance(), ilObject\_lookupType(), getUdfFilter(), IL_CAL_DATETIME, IL_CAL_DAY, IL_CAL_UNIX, UDF_TYPE_TEXT, and UDF_TYPE_WYSIWYG.

275  {
276  global $DIC;
277 
278  $ilDB = $DIC['ilDB'];
279 
280 
281  $udf_fields = array();
282 
283  $join = "";
284 
285  if (is_array($this->additional_fields)) {
286  foreach ($this->additional_fields as $f) {
287  if (!in_array($f, $this->default_fields)) {
288  if ($f == "online_time") {
289  $this->default_fields[] = "ut_online.online_time";
290  $join = " LEFT JOIN ut_online ON (usr_data.usr_id = ut_online.usr_id) ";
291  } elseif (substr($f, 0, 4) == "udf_") {
292  $udf_fields[] = (int) substr($f, 4);
293  } else {
294  $this->default_fields[] = $f;
295  }
296  }
297  }
298  }
299 
300  // if udf fields are involved we need the definitions
301  $udf_def = array();
302  if (count($udf_fields) > 0) {
303  include_once './Services/User/classes/class.ilUserDefinedFields.php';
304  $udf_def = ilUserDefinedFields::_getInstance()->getDefinitions();
305  }
306 
307  // join udf table
308  foreach ($udf_fields as $id) {
309  $udf_table = ($udf_def[$id]["field_type"] != UDF_TYPE_WYSIWYG)
310  ? "udf_text"
311  : "udf_clob";
312  $join .= " LEFT JOIN " . $udf_table . " ud_" . $id . " ON (ud_" . $id . ".field_id=" . $ilDB->quote($id) . " AND ud_" . $id . ".usr_id = usr_data.usr_id) ";
313  }
314 
315  // count query
316  $count_query = "SELECT count(usr_data.usr_id) cnt" .
317  " FROM usr_data";
318 
319  $all_multi_fields = array("interests_general", "interests_help_offered", "interests_help_looking");
320  $multi_fields = array();
321 
322  $sql_fields = array();
323  foreach ($this->default_fields as $idx => $field) {
324  if (!$field) {
325  continue;
326  }
327 
328  if (in_array($field, $all_multi_fields)) {
329  $multi_fields[] = $field;
330  } elseif (!stristr($field, ".")) {
331  $sql_fields[] = "usr_data." . $field;
332  } else {
333  $sql_fields[] = $field;
334  }
335  }
336 
337  // udf fields
338  foreach ($udf_fields as $id) {
339  $sql_fields[] = "ud_" . $id . ".value udf_" . $id;
340  }
341 
342  // basic query
343  $query = "SELECT " . implode($sql_fields, ",") .
344  " FROM usr_data" .
345  $join;
346 
347  $count_query = $count_query . " " .
348  $join;
349 
350  // filter
351  $query .= " WHERE usr_data.usr_id <> " . $ilDB->quote(ANONYMOUS_USER_ID, "integer");
352 
353  // User filter
354  $count_query .= " WHERE 1 = 1 ";
355  $count_user_filter = "usr_data.usr_id != " . $ilDB->quote(ANONYMOUS_USER_ID, "integer");
356  if ($this->users and is_array(($this->users))) {
357  $query .= ' AND ' . $ilDB->in('usr_data.usr_id', $this->users, false, 'integer');
358  $count_user_filter = $ilDB->in('usr_data.usr_id', $this->users, false, 'integer');
359  }
360 
361  $count_query .= " AND " . $count_user_filter . " ";
362  $where = " AND";
363 
364  if ($this->first_letter != "") {
365  $add = $where . " (" . $ilDB->upper($ilDB->substr("usr_data.lastname", 1, 1)) . " = " . $ilDB->upper($ilDB->quote($this->first_letter, "text")) . ") ";
366  $query .= $add;
367  $count_query .= $add;
368  $where = " AND";
369  }
370 
371  if ($this->text_filter != "") { // email, name, login
372  $add = $where . " (" . $ilDB->like("usr_data.login", "text", "%" . $this->text_filter . "%") . " " .
373  "OR " . $ilDB->like("usr_data.firstname", "text", "%" . $this->text_filter . "%") . " " .
374  "OR " . $ilDB->like("usr_data.lastname", "text", "%" . $this->text_filter . "%") . " " .
375  "OR " . $ilDB->like("usr_data.second_email", "text", "%" . $this->text_filter . "%") . " " .
376  "OR " . $ilDB->like("usr_data.email", "text", "%" . $this->text_filter . "%") . ") ";
377  $query .= $add;
378  $count_query .= $add;
379  $where = " AND";
380  }
381 
382  if ($this->activation != "") { // activation
383  if ($this->activation == "inactive") {
384  $add = $where . " usr_data.active = " . $ilDB->quote(0, "integer") . " ";
385  } else {
386  $add = $where . " usr_data.active = " . $ilDB->quote(1, "integer") . " ";
387  }
388  $query .= $add;
389  $count_query .= $add;
390  $where = " AND";
391  }
392 
393  if ($this->last_login instanceof ilDateTime) { // last login
394  if (ilDateTime::_before($this->last_login, new ilDateTime(time(), IL_CAL_UNIX), IL_CAL_DAY)) {
395  $add = $where . " usr_data.last_login < " .
396  $ilDB->quote($this->last_login->get(IL_CAL_DATETIME), "timestamp");
397  $query .= $add;
398  $count_query .= $add;
399  $where = " AND";
400  }
401  }
402  if ($this->limited_access) { // limited access
403  $add = $where . " usr_data.time_limit_unlimited= " . $ilDB->quote(0, "integer");
404  $query .= $add;
405  $count_query .= $add;
406  $where = " AND";
407  }
408 
409  // udf filter
410  foreach ($this->getUdfFilter() as $k => $f) {
411  if ($f != "") {
412  $udf_id = explode("_", $k)[1];
413  if ($udf_def[$udf_id]["field_type"] == UDF_TYPE_TEXT) {
414  $add = $where . " " . $ilDB->like("ud_" . $udf_id . ".value", "text", "%" . $f . "%");
415  } else {
416  $add = $where . " ud_" . $udf_id . ".value = " . $ilDB->quote($f, "text");
417  }
418  $query .= $add;
419  $count_query .= $add;
420  $where = " AND";
421  }
422  }
423 
424  if ($this->has_access) { //user is limited but has access
425  $unlimited = "time_limit_unlimited = " . $ilDB->quote(1, 'integer');
426  $from = "time_limit_from < " . $ilDB->quote(time(), 'integer');
427  $until = "time_limit_until > " . $ilDB->quote(time(), 'integer');
428 
429  $add = $where . ' (' . $unlimited . ' OR (' . $from . ' AND ' . $until . '))';
430  $query .= $add;
431  $count_query .= $add;
432  $where = " AND";
433  }
434  if ($this->no_courses) { // no courses assigned
435  $add = $where . " usr_data.usr_id NOT IN (" .
436  "SELECT DISTINCT ud.usr_id " .
437  "FROM usr_data ud join rbac_ua ON (ud.usr_id = rbac_ua.usr_id) " .
438  "JOIN object_data od ON (rbac_ua.rol_id = od.obj_id) " .
439  "WHERE od.title LIKE 'il_crs_%')";
440  $query .= $add;
441  $count_query .= $add;
442  $where = " AND";
443  }
444  if ($this->no_groups) { // no groups assigned
445  $add = $where . " usr_data.usr_id NOT IN (" .
446  "SELECT DISTINCT ud.usr_id " .
447  "FROM usr_data ud join rbac_ua ON (ud.usr_id = rbac_ua.usr_id) " .
448  "JOIN object_data od ON (rbac_ua.rol_id = od.obj_id) " .
449  "WHERE od.title LIKE 'il_grp_%')";
450  $query .= $add;
451  $count_query .= $add;
452  $where = " AND";
453  }
454  if ($this->crs_grp > 0) { // members of course/group
455  $cgtype = ilObject::_lookupType($this->crs_grp, true);
456  $add = $where . " usr_data.usr_id IN (" .
457  "SELECT DISTINCT ud.usr_id " .
458  "FROM usr_data ud join rbac_ua ON (ud.usr_id = rbac_ua.usr_id) " .
459  "JOIN object_data od ON (rbac_ua.rol_id = od.obj_id) " .
460  "WHERE od.title = " . $ilDB->quote("il_" . $cgtype . "_member_" . $this->crs_grp, "text") . ")";
461  $query .= $add;
462  $count_query .= $add;
463  $where = " AND";
464  }
465  if ($this->role > 0) { // global role
466  $add = $where . " usr_data.usr_id IN (" .
467  "SELECT DISTINCT ud.usr_id " .
468  "FROM usr_data ud join rbac_ua ON (ud.usr_id = rbac_ua.usr_id) " .
469  "WHERE rbac_ua.rol_id = " . $ilDB->quote($this->role, "integer") . ")";
470  $query .= $add;
471  $count_query .= $add;
472  $where = " AND";
473  }
474 
475  if ($this->user_folder) {
476  $add = $where . " " . $ilDB->in('usr_data.time_limit_owner', $this->user_folder, false, 'integer');
477  $query .= $add;
478  $count_query .= $add;
479  $where = " AND";
480  }
481 
482  if ($this->authentication_method != "") { // authentication
483  $add = $where . " usr_data.auth_mode = " . $ilDB->quote($this->authentication_method, "text") . " ";
484  $query .= $add;
485  $count_query .= $add;
486  $where = " AND";
487  }
488 
489  // order by
490  switch ($this->order_field) {
491  case "access_until":
492  if ($this->order_dir == "desc") {
493  $query .= " ORDER BY usr_data.active DESC, usr_data.time_limit_unlimited DESC, usr_data.time_limit_until DESC";
494  } else {
495  $query .= " ORDER BY usr_data.active ASC, usr_data.time_limit_unlimited ASC, usr_data.time_limit_until ASC";
496  }
497  break;
498 
499  case "online_time":
500  if ($this->order_dir == "desc") {
501  $query .= " ORDER BY ut_online.online_time DESC";
502  } else {
503  $query .= " ORDER BY ut_online.online_time ASC";
504  }
505  break;
506 
507  default:
508  if ($this->order_dir != "asc" && $this->order_dir != "desc") {
509  $this->order_dir = "asc";
510  }
511  if (substr($this->order_field, 0, 4) == "udf_") {
512  // #25311 check if order field is in field list
513  if (is_array($this->getUdfFilter()) && array_key_exists($this->order_field, $this->getUdfFilter())) {
514  $query .= " ORDER BY ud_" . ((int) substr($this->order_field, 4)) . ".value " . strtoupper($this->order_dir);
515  } else {
516  $query .= ' ORDER BY ' . self::DEFAULT_ORDER_FIELD . ' ' . strtoupper($this->order_dir);
517  }
518  } else {
519  if (!in_array($this->order_field, $this->default_fields)) {
520  $this->order_field = "login";
521  }
522  $query .= " ORDER BY usr_data." . $this->order_field . " " . strtoupper($this->order_dir);
523  }
524  break;
525  }
526 
527  // count query
528  $set = $ilDB->query($count_query);
529  $cnt = 0;
530  if ($rec = $ilDB->fetchAssoc($set)) {
531  $cnt = $rec["cnt"];
532  }
533 
534  $offset = (int) $this->offset;
535  $limit = (int) $this->limit;
536 
537  // #9866: validate offset against rowcount
538  if ($offset >= $cnt) {
539  $offset = 0;
540  }
541 
542  $ilDB->setLimit($limit, $offset);
543 
544  if (sizeof($multi_fields)) {
545  $usr_ids = array();
546  }
547 
548  // set query
549  $set = $ilDB->query($query);
550  $result = array();
551 
552  while ($rec = $ilDB->fetchAssoc($set)) {
553  $result[] = $rec;
554  if (sizeof($multi_fields)) {
555  $usr_ids[] = $rec["usr_id"];
556  }
557  }
558 
559  // add multi-field-values to user-data
560  if (sizeof($multi_fields) && sizeof($usr_ids)) {
561  $usr_multi = array();
562  $set = $ilDB->query("SELECT * FROM usr_data_multi" .
563  " WHERE " . $ilDB->in("usr_id", $usr_ids, "", "integer"));
564  while ($row = $ilDB->fetchAssoc($set)) {
565  $usr_multi[$row["usr_id"]][$row["field_id"]][] = $row["value"];
566  }
567  foreach ($result as $idx => $item) {
568  if (isset($usr_multi[$item["usr_id"]])) {
569  $result[$idx] = array_merge($item, $usr_multi[$item["usr_id"]]);
570  }
571  }
572  }
573  return array("cnt" => $cnt, "set" => $result);
574  }
getUdfFilter()
Get udf filter.
const IL_CAL_DATETIME
static _getInstance()
Get instance.
$result
global $DIC
Definition: saml.php:7
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
if(!array_key_exists('StateId', $_REQUEST)) $id
$from
const IL_CAL_UNIX
const IL_CAL_DAY
const UDF_TYPE_TEXT
Date and time handling
$query
const UDF_TYPE_WYSIWYG
static _lookupType($a_id, $a_reference=false)
lookup object type
$row
global $ilDB
+ Here is the call graph for this function:

◆ setAccessFilter()

ilUserQuery::setAccessFilter (   $a_access)

set filter for user that are limited but has access

Parameters
$a_access

Definition at line 255 of file class.ilUserQuery.php.

256  {
257  $this->has_access = (bool) $a_access;
258  }

◆ setActionFilter()

ilUserQuery::setActionFilter (   $a_activation)

Set activation filter 'active' or 'inactive' or empty.

Parameters
string$a_activation

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

153  {
154  $this->activation = $a_activation;
155  }

◆ setAdditionalFields()

ilUserQuery::setAdditionalFields (   $a_add)

Set additional fields (columns in usr_data or 'online_time')

Parameters
array$additional_fields

Definition at line 227 of file class.ilUserQuery.php.

228  {
229  $this->additional_fields = (array) $a_add;
230  }

◆ setAuthenticationFilter()

ilUserQuery::setAuthenticationFilter (   $a_authentication)

Set authentication filter 'default', 'local' or 'lti'.

Parameters
string$a_authentication

Definition at line 265 of file class.ilUserQuery.php.

266  {
267  $this->authentication_method = $a_authentication;
268  }

◆ setCourseGroupFilter()

ilUserQuery::setCourseGroupFilter (   $a_cg_id)

Set course / group filter object_id of course or group.

Parameters
int$a_cg_id

Definition at line 198 of file class.ilUserQuery.php.

199  {
200  $this->crs_grp = $a_cg_id;
201  }

◆ setFirstLetterLastname()

ilUserQuery::setFirstLetterLastname (   $a_fll)

set first letter lastname filter

Parameters
string$a_fll

Definition at line 245 of file class.ilUserQuery.php.

246  {
247  $this->first_letter = $a_fll;
248  }

◆ setLastLogin()

ilUserQuery::setLastLogin ( ilDateTime  $dt = null)

Set last login filter.

Parameters
ilDateTime$dt

Definition at line 161 of file class.ilUserQuery.php.

162  {
163  $this->last_login = $dt;
164  }

◆ setLimit()

ilUserQuery::setLimit (   $a_limit)

Set result limit Default is 50.

Parameters
int$a_limit

Definition at line 133 of file class.ilUserQuery.php.

134  {
135  $this->limit = $a_limit;
136  }

◆ setLimitedAccessFilter()

ilUserQuery::setLimitedAccessFilter (   $a_status)

Enable limited access filter.

Parameters
bool

Definition at line 170 of file class.ilUserQuery.php.

171  {
172  $this->limited_access = $a_status;
173  }

◆ setNoCourseFilter()

ilUserQuery::setNoCourseFilter (   $a_no_course)

Enable no course filter.

Parameters
bool$a_no_course

Definition at line 179 of file class.ilUserQuery.php.

180  {
181  $this->no_courses = $a_no_course;
182  }

◆ setNoGroupFilter()

ilUserQuery::setNoGroupFilter (   $a_no_group)

Enable no group filter.

Parameters
bool$a_no_group

Definition at line 188 of file class.ilUserQuery.php.

189  {
190  $this->no_groups = $a_no_group;
191  }

◆ setOffset()

ilUserQuery::setOffset (   $a_offset)

Set offset.

Parameters
int$a_offset

Definition at line 123 of file class.ilUserQuery.php.

124  {
125  $this->offset = $a_offset;
126  }

◆ setOrderDirection()

ilUserQuery::setOrderDirection (   $a_dir)

Set order direction 'asc' or 'desc' Default is 'asc'.

Parameters
string$a_dir

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

115  {
116  $this->order_dir = $a_dir;
117  }

◆ setOrderField()

ilUserQuery::setOrderField (   $a_order)

Set order field (column in usr_data) Default order is 'login'.

Parameters
string

Definition at line 103 of file class.ilUserQuery.php.

104  {
105  $this->order_field = $a_order;
106  }

◆ setRoleFilter()

ilUserQuery::setRoleFilter (   $a_role_id)

Set role filter obj_id of role.

Parameters
int$a_role_id

Definition at line 208 of file class.ilUserQuery.php.

209  {
210  $this->role = $a_role_id;
211  }

◆ setTextFilter()

ilUserQuery::setTextFilter (   $a_filter)

Text (like) filter in login, firstname, lastname or email.

Parameters
stringfilter

Definition at line 142 of file class.ilUserQuery.php.

143  {
144  $this->text_filter = $a_filter;
145  }

◆ setUdfFilter()

ilUserQuery::setUdfFilter (   $a_val)

Set udf filter.

Parameters
array$a_valudf filter array

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

References ilUserDefinedFields\_getInstance().

75  {
76  $valid_udfs = [];
77 
78  $definitions = \ilUserDefinedFields::_getInstance()->getDefinitions();
79  foreach ((array) $a_val as $udf_name => $udf_value) {
80  list($udf_string, $udf_id) = explode('_', $udf_name);
81  if (array_key_exists((int) $udf_id, $definitions)) {
82  $valid_udfs[$udf_name] = $udf_value;
83  }
84  }
85  $this->udf_filter = $valid_udfs;
86  }
static _getInstance()
Get instance.
+ Here is the call graph for this function:

◆ setUserFilter()

ilUserQuery::setUserFilter (   $a_filter)

Array with user ids to query against.

Parameters
array$a_filter

Definition at line 236 of file class.ilUserQuery.php.

237  {
238  $this->users = $a_filter;
239  }

◆ setUserFolder()

ilUserQuery::setUserFolder (   $a_fold_id)

Set user folder filter reference id of user folder or category (local user administration)

Parameters
int$a_fold_id

Definition at line 218 of file class.ilUserQuery.php.

219  {
220  $this->user_folder = $a_fold_id;
221  }

Field Documentation

◆ $activation

ilUserQuery::$activation = ''
private

Definition at line 26 of file class.ilUserQuery.php.

◆ $additional_fields

ilUserQuery::$additional_fields = array()
private

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

◆ $authentication_method

ilUserQuery::$authentication_method = ''
private

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

◆ $crs_grp

ilUserQuery::$crs_grp = 0
private

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

◆ $default_fields

ilUserQuery::$default_fields
private
Initial value:
= array(
"usr_id",
"login",
"firstname",
"lastname",
"email",
"second_email",
"time_limit_until",
"time_limit_unlimited",
"time_limit_owner",
"last_login",
"active"
)

Definition at line 45 of file class.ilUserQuery.php.

◆ $first_letter

ilUserQuery::$first_letter = ''
private

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

◆ $has_access

ilUserQuery::$has_access = false
private

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

◆ $last_login

ilUserQuery::$last_login = null
private

Definition at line 27 of file class.ilUserQuery.php.

◆ $limit

ilUserQuery::$limit = 50
private

Definition at line 24 of file class.ilUserQuery.php.

Referenced by query().

◆ $limited_access

ilUserQuery::$limited_access = false
private

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

◆ $logger

ilUserQuery::$logger = null
private

Definition at line 19 of file class.ilUserQuery.php.

◆ $no_courses

ilUserQuery::$no_courses = false
private

Definition at line 29 of file class.ilUserQuery.php.

◆ $no_groups

ilUserQuery::$no_groups = false
private

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

◆ $offset

ilUserQuery::$offset = 0
private

Definition at line 23 of file class.ilUserQuery.php.

Referenced by query().

◆ $order_dir

ilUserQuery::$order_dir = 'asc'
private

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

◆ $order_field

ilUserQuery::$order_field = self::DEFAULT_ORDER_FIELD
private

Definition at line 21 of file class.ilUserQuery.php.

◆ $role

ilUserQuery::$role = 0
private

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

◆ $text_filter

ilUserQuery::$text_filter = ''
private

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

◆ $udf_filter

ilUserQuery::$udf_filter = array()
protected

Definition at line 43 of file class.ilUserQuery.php.

Referenced by getUdfFilter().

◆ $user_folder

ilUserQuery::$user_folder = 0
private

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

◆ $users

ilUserQuery::$users = array()
private

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

◆ DEFAULT_ORDER_FIELD

const ilUserQuery::DEFAULT_ORDER_FIELD = 'login'

Definition at line 14 of file class.ilUserQuery.php.


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