ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilUserFilter Class Reference

user filter More...

+ Collaboration diagram for ilUserFilter:

Public Member Functions

 filter ($a_user_ids)
 Filter user accounts. More...
 
 getFolderIds ()
 Get accessible user folder (cat and usrf) ids. More...
 

Static Public Member Functions

static getInstance ()
 Singelton get instance. More...
 

Protected Member Functions

 __construct ()
 Singleton constructor. More...
 

Private Member Functions

 init ()
 Init. More...
 

Private Attributes

 $settings = null
 
 $folder_ids = array()
 

Static Private Attributes

static $instance = null
 

Detailed Description

user filter

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilUserFilter.php.

Constructor & Destructor Documentation

◆ __construct()

ilUserFilter::__construct ( )
protected

Singleton constructor.

Returns

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

References init().

30  {
31  $this->init();
32  }
+ Here is the call graph for this function:

Member Function Documentation

◆ filter()

ilUserFilter::filter (   $a_user_ids)

Filter user accounts.

Returns

Definition at line 51 of file class.ilUserFilter.php.

References $ilDB, $query, $res, $row, array, ilDBConstants\FETCHMODE_ASSOC, and ilUserAccountSettings\getInstance().

52  {
53  global $ilDB;
54 
55  if(!ilUserAccountSettings::getInstance()->isUserAccessRestricted())
56  {
57  return $a_user_ids;
58  }
59 
60  $query = "SELECT usr_id FROM usr_data ".
61  "WHERE ".$ilDB->in('time_limit_owner',$this->folder_ids,false,'integer')." ".
62  "AND ".$ilDB->in('usr_id',$a_user_ids,false,'integer');
63  $res = $ilDB->query($query);
64 
65  $filtered = array();
66  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_ASSOC))
67  {
68  $filtered[] = $row['usr_id'];
69  }
70  return $filtered;
71  }
Create styles array
The data for the language used.
static getInstance()
Singelton get instance.
global $ilDB
+ Here is the call graph for this function:

◆ getFolderIds()

ilUserFilter::getFolderIds ( )

Get accessible user folder (cat and usrf) ids.

Returns

Definition at line 77 of file class.ilUserFilter.php.

References $folder_ids, and array.

78  {
79  return (array) $this->folder_ids;
80  }
Create styles array
The data for the language used.

◆ getInstance()

static ilUserFilter::getInstance ( )
static

Singelton get instance.

Returns
object ilUserFilter

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

Referenced by ilObjUser\_writeHistory(), ilMailAutoCompleteUserProvider\getSelectPart(), ilUserAutoComplete\getSelectPart(), ilRepositorySearchGUI\listUsers(), ilRepositoryObjectResultTableGUI\parseObjectIds(), ilRepositorySearchGUI\performSearch(), and ilMailSearchGUI\showResults().

39  {
40  if(self::$instance)
41  {
42  return self::$instance;
43  }
44  return self::$instance = new ilUserFilter();
45  }
+ Here is the caller graph for this function:

◆ init()

ilUserFilter::init ( )
private

Init.

Returns

Definition at line 86 of file class.ilUserFilter.php.

References ilLocalUser\_getFolderIds(), and ilUserAccountSettings\getInstance().

Referenced by __construct().

87  {
88  if(ilUserAccountSettings::getInstance()->isUserAccessRestricted())
89  {
90  include_once './Services/User/classes/class.ilLocalUser.php';
91  $this->folder_ids = ilLocalUser::_getFolderIds();
92  }
93  }
static getInstance()
Singelton get instance.
static _getFolderIds()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $folder_ids

ilUserFilter::$folder_ids = array()
private

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

Referenced by getFolderIds().

◆ $instance

ilUserFilter::$instance = null
staticprivate

Definition at line 18 of file class.ilUserFilter.php.

◆ $settings

ilUserFilter::$settings = null
private

Definition at line 20 of file class.ilUserFilter.php.


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