ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilLocalUser Class Reference
+ Collaboration diagram for ilLocalUser:

Public Member Functions

 __construct ($a_parent_id)
 Constructor public. More...
 
 setParentId ($a_parent_id)
 
 getParentId ()
 

Static Public Member Functions

static _getUserData ($a_filter)
 
static _getFolderIds ()
 
static _getAllUserIds ($a_filter=0)
 
static _getUserFolderId ()
 

Data Fields

 $db
 
 $parent_id
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilLocalUser::__construct (   $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

Member Function Documentation

◆ _getAllUserIds()

static ilLocalUser::_getAllUserIds (   $a_filter = 0)
static

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

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

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  }
Create styles array
The data for the language used.
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 58 of file class.ilLocalUser.php.

References $ilDB, $query, $res, $row, array, ilDBConstants\FETCHMODE_OBJECT, and USER_FOLDER_ID.

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

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

◆ _getUserData()

static ilLocalUser::_getUserData (   $a_filter)
static

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

References ilObjUser\_getAllUserData(), and array.

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

◆ _getUserFolderId()

static ilLocalUser::_getUserFolderId ( )
static

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

128  {
129  return 7;
130  }

◆ getParentId()

ilLocalUser::getParentId ( )

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

References $parent_id.

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

◆ 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: