ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLocalUser Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilLocalUser:

Public Member Functions

 __construct (int $a_parent_id)
 
 setParentId (int $a_parent_id)
 
 getParentId ()
 

Static Public Member Functions

static _getFolderIds (bool $access_with_orgunit=false)
 
static _getAllUserIds (int $a_filter=0)
 
static _getUserFolderId ()
 

Data Fields

ilDBInterface $db
 
int $parent_id
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Helper class for local user accounts (in categories)

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Constructor & Destructor Documentation

◆ __construct()

ilLocalUser::__construct ( int  $a_parent_id)

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

31 {
32 global $DIC;
33
34 $ilDB = $DIC['ilDB'];
35
36 $this->db = $ilDB;
37 $this->parent_id = $a_parent_id;
38 }
global $DIC
Definition: shib_login.php:26

References $DIC, and $ilDB.

Member Function Documentation

◆ _getAllUserIds()

static ilLocalUser::_getAllUserIds ( int  $a_filter = 0)
static
Parameters
int$a_filter
Returns
int[]

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

94 : array {
95 global $DIC;
96
97 $ilDB = $DIC['ilDB'];
98 switch ($a_filter) {
99 case 0:
100 if (self::_getFolderIds()) {
101 $where = "WHERE " . $ilDB->in("time_limit_owner", self::_getFolderIds(), false, "integer") . " ";
102 } else {
103 return [];
104 }
105
106 break;
107
108 default:
109 $where = "WHERE time_limit_owner = " . $ilDB->quote($a_filter, "integer") . " ";
110
111 break;
112 }
113
114 $query = "SELECT usr_id FROM usr_data " . $where;
115 $res = $ilDB->query($query);
116
117 $users = [];
118 while ($row = $ilDB->fetchObject($res)) {
119 $users[] = (int) $row->usr_id;
120 }
121
122 return $users;
123 }
$res
Definition: ltiservices.php:69

References $ilDB.

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

+ Here is the caller graph for this function:

◆ _getFolderIds()

static ilLocalUser::_getFolderIds ( bool  $access_with_orgunit = false)
static
Parameters
bool$access_with_orgunit
Returns
int[]

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

56 : array {
57 global $DIC;
58
59 $ilDB = $DIC['ilDB'];
60 $access = $DIC->access();
61 $rbacsystem = $DIC['rbacsystem'];
62 $parent = [];
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 || (int) $row->parent_id === USER_FOLDER_ID) {
70 if ($rbacsystem->checkAccess('read', USER_FOLDER_ID) ||
71 ($access_with_orgunit && $access->checkPositionAccess(\ilObjUserFolder::ORG_OP_EDIT_USER_ACCOUNTS, USER_FOLDER_ID))) {
72 $parent[] = (int) $row->parent_id;
73 }
74 continue;
75 }
76
77 if ($rbacsystem->checkAccess('read_users', $row->parent_id) ||
78 ($access_with_orgunit && $access->checkPositionAccess(ilObjUserFolder::ORG_OP_EDIT_USER_ACCOUNTS, $row->parent_id))
79 || $rbacsystem->checkAccess('cat_administrate_users', $row->parent_id)) {
80 if ($row->parent_id) {
81 $parent[] = (int) $row->parent_id;
82 }
83 }
84 }
85 return $parent ?: [];
86 }
const USER_FOLDER_ID
Definition: constants.php:33

References ILIAS\Repository\int(), ilObjUserFolder\ORG_OP_EDIT_USER_ACCOUNTS, and USER_FOLDER_ID.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getUserFolderId()

static ilLocalUser::_getUserFolderId ( )
static

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

125 : int
126 {
127 return 7;
128 }

Referenced by ilObjUserFolderGUI\getActionUserIds().

+ Here is the caller graph for this function:

◆ getParentId()

ilLocalUser::getParentId ( )

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

45 : int
46 {
47 return $this->parent_id;
48 }

References $parent_id.

◆ setParentId()

ilLocalUser::setParentId ( int  $a_parent_id)

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

40 : void
41 {
42 $this->parent_id = $a_parent_id;
43 }

Field Documentation

◆ $db

ilDBInterface ilLocalUser::$db

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

◆ $parent_id

int ilLocalUser::$parent_id

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

Referenced by getParentId().


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