ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLocalUser Class Reference
+ Collaboration diagram for ilLocalUser:

Public Member Functions

 ilLocalUser ($a_parent_id)
 Constructor public. More...
 
 setParentId ($a_parent_id)
 
 getParentId ()
 
 _getUserData ($a_filter)
 
 _getAllUserIds ($a_filter=0)
 
 _getUserFolderId ()
 

Static Public Member Functions

static _getFolderIds ()
 

Data Fields

 $db
 
 $parent_id
 

Detailed Description

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

Member Function Documentation

◆ _getAllUserIds()

ilLocalUser::_getAllUserIds (   $a_filter = 0)

Definition at line 88 of file class.ilLocalUser.php.

References $ilDB, $query, $res, $row, and _getFolderIds().

Referenced by ilLocalUserGUI\assignSave(), ilObjCategoryGUI\assignSaveObject(), ilLocalUserGUI\performDeleteUsers(), and ilObjCategoryGUI\performDeleteUsersObject().

89  {
90  global $ilDB;
91  switch($a_filter)
92  {
93  case 0:
95  {
96  $where = "WHERE ".$ilDB->in("time_limit_owner", ilLocalUser::_getFolderIds(), false, "integer")." ";
97  //$where .= '(';
98  //$where .= implode(",",ilUtil::quoteArray(ilLocalUser::_getFolderIds()));
99  //$where .= ')';
100 
101  }
102  else
103  {
104  //$where = "WHERE time_limit_owner IN ('')";
105  return array();
106  }
107 
108  break;
109 
110  default:
111  $where = "WHERE time_limit_owner = ".$ilDB->quote($a_filter, "integer")." ";
112 
113  break;
114  }
115 
116  $query = "SELECT usr_id FROM usr_data ".$where;
117  $res = $ilDB->query($query);
118 
119  while($row = $ilDB->fetchObject($res))
120  {
121  $users[] = $row->usr_id;
122  }
123 
124  return $users ? $users : array();
125  }
global $ilDB
static _getFolderIds()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getFolderIds()

static ilLocalUser::_getFolderIds ( )
static

Definition at line 59 of file class.ilLocalUser.php.

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and USER_FOLDER_ID.

Referenced by _getAllUserIds(), ilUserTableGUI\getItems(), ilUserTableGUI\getUserIdsForFilter(), ilUserFilter\init(), and ilUserTableGUI\initFilter().

60  {
61  global $ilDB,$rbacsystem;
62 
63  $query = "SELECT DISTINCT(time_limit_owner) as parent_id FROM usr_data ";
64 
65  $res = $ilDB->query($query);
66  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
67  {
68  // Workaround for users with time limit owner "0".
69  if(!$row->parent_id)
70  {
71  if($rbacsystem->checkAccess('read_users',USER_FOLDER_ID))
72  {
73  $parent[] = $row->parent_id;
74  }
75  continue;
76  }
77 
78  if($rbacsystem->checkAccess('read_users',$row->parent_id) or $rbacsystem->checkAccess('cat_administrate_users',$row->parent_id))
79  {
80  if($row->parent_id)
81  {
82  $parent[] = $row->parent_id;
83  }
84  }
85  }
86  return $parent ? $parent : array();
87  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
global $ilDB
const USER_FOLDER_ID
Class ilObjUserFolder.
+ Here is the caller graph for this function:

◆ _getUserData()

ilLocalUser::_getUserData (   $a_filter)

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

References ilObjUser\_getAllUserData().

44  {
45  include_once './Services/User/classes/class.ilObjUser.php';
46 
47  $users_data = ilObjUser::_getAllUserData(array("login","firstname","lastname","time_limit_owner"),-1);
48 
49  foreach($users_data as $usr_data)
50  {
51  if(!$a_filter or $a_filter == $usr_data['time_limit_owner'])
52  {
53  $users[] = $usr_data;
54  }
55  }
56  return $users ? $users : array();
57  }
_getAllUserData($a_fields=NULL, $active=-1)
STATIC METHOD get all user data.
+ Here is the call graph for this function:

◆ _getUserFolderId()

ilLocalUser::_getUserFolderId ( )

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

Referenced by ilObjCategoryGUI\__buildFilterSelect().

128  {
129  return 7;
130  }
+ Here is the caller graph for this function:

◆ getParentId()

ilLocalUser::getParentId ( )

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

References $parent_id.

38  {
39  return $this->parent_id;
40  }

◆ ilLocalUser()

ilLocalUser::ilLocalUser (   $a_parent_id)

Constructor public.

Parameters
stringscriptname
intuser_id

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

References $ilDB.

25  {
26  global $ilDB;
27 
28  $this->db =& $ilDB;
29  $this->parent_id = $a_parent_id;
30 
31  }
global $ilDB

◆ setParentId()

ilLocalUser::setParentId (   $a_parent_id)

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

34  {
35  $this->parent_id = $a_parent_id;
36  }

Field Documentation

◆ $db

ilLocalUser::$db

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

◆ $parent_id

ilLocalUser::$parent_id

Definition at line 16 of file class.ilLocalUser.php.

Referenced by getParentId().


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