ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC, and $ilDB.

25  {
26  global $DIC;
27 
28  $ilDB = $DIC['ilDB'];
29 
30  $this->db = $ilDB;
31  $this->parent_id = $a_parent_id;
32  }
global $DIC
Definition: saml.php:7
global $ilDB

Member Function Documentation

◆ _getAllUserIds()

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

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

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

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

86  {
87  global $DIC;
88 
89  $ilDB = $DIC['ilDB'];
90  switch ($a_filter) {
91  case 0:
93  $where = "WHERE " . $ilDB->in("time_limit_owner", ilLocalUser::_getFolderIds(), false, "integer") . " ";
94  //$where .= '(';
95  //$where .= implode(",",ilUtil::quoteArray(ilLocalUser::_getFolderIds()));
96  //$where .= ')';
97  } else {
98  //$where = "WHERE time_limit_owner IN ('')";
99  return array();
100  }
101 
102  break;
103 
104  default:
105  $where = "WHERE time_limit_owner = " . $ilDB->quote($a_filter, "integer") . " ";
106 
107  break;
108  }
109 
110  $query = "SELECT usr_id FROM usr_data " . $where;
111  $res = $ilDB->query($query);
112 
113  while ($row = $ilDB->fetchObject($res)) {
114  $users[] = $row->usr_id;
115  }
116 
117  return $users ? $users : array();
118  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$users
Definition: authpage.php:44
$row
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 57 of file class.ilLocalUser.php.

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

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

58  {
59  global $DIC;
60 
61  $ilDB = $DIC['ilDB'];
62  $rbacsystem = $DIC['rbacsystem'];
63 
64  $query = "SELECT DISTINCT(time_limit_owner) as parent_id FROM usr_data ";
65 
66  $res = $ilDB->query($query);
67  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
68  // Workaround for users with time limit owner "0".
69  if (!$row->parent_id) {
70  if ($rbacsystem->checkAccess('read_users', USER_FOLDER_ID)) {
71  $parent[] = $row->parent_id;
72  }
73  continue;
74  }
75 
76  if ($rbacsystem->checkAccess('read_users', $row->parent_id) or $rbacsystem->checkAccess('cat_administrate_users', $row->parent_id)) {
77  if ($row->parent_id) {
78  $parent[] = $row->parent_id;
79  }
80  }
81  }
82  return $parent ? $parent : array();
83  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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 43 of file class.ilLocalUser.php.

References $users, and 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  if (!$a_filter or $a_filter == $usr_data['time_limit_owner']) {
51  $users[] = $usr_data;
52  }
53  }
54  return $users ? $users : array();
55  }
static _getAllUserData($a_fields=null, $active=-1)
STATIC METHOD get all user data.
$users
Definition: authpage.php:44
+ Here is the call graph for this function:

◆ _getUserFolderId()

static ilLocalUser::_getUserFolderId ( )
static

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

121  {
122  return 7;
123  }

◆ getParentId()

ilLocalUser::getParentId ( )

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

References $parent_id.

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

◆ setParentId()

ilLocalUser::setParentId (   $a_parent_id)

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

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

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: