ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilLocalUser.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
/*
5
* Helper class for local user accounts (in categories)
6
*
7
* @author Stefan Meyer <meyer@leifos.com>
8
* @version $Id$
9
*
10
*/
11
12
class
ilLocalUser
13
{
14
public
$db
;
15
16
public
$parent_id
;
17
24
public
function
__construct
($a_parent_id)
25
{
26
global
$DIC
;
27
28
$ilDB
= $DIC[
'ilDB'
];
29
30
$this->db =
$ilDB
;
31
$this->parent_id = $a_parent_id;
32
}
33
34
public
function
setParentId
($a_parent_id)
35
{
36
$this->parent_id = $a_parent_id;
37
}
38
public
function
getParentId
()
39
{
40
return
$this->parent_id
;
41
}
42
43
public
static
function
_getUserData
($a_filter)
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
}
56
57
public
static
function
_getFolderIds
()
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
}
84
85
public
static
function
_getAllUserIds
($a_filter = 0)
86
{
87
global
$DIC
;
88
89
$ilDB
= $DIC[
'ilDB'
];
90
switch
($a_filter) {
91
case
0:
92
if
(
ilLocalUser::_getFolderIds
()) {
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
}
119
120
public
static
function
_getUserFolderId
()
121
{
122
return
7;
123
}
124
}
// CLASS ilLocalUser
ilLocalUser\$db
$db
Definition:
class.ilLocalUser.php:14
ilLocalUser\getParentId
getParentId()
Definition:
class.ilLocalUser.php:38
$DIC
global $DIC
Definition:
saml.php:7
ilLocalUser\setParentId
setParentId($a_parent_id)
Definition:
class.ilLocalUser.php:34
ilObjUser\_getAllUserData
static _getAllUserData($a_fields=null, $active=-1)
STATIC METHOD get all user data.
Definition:
class.ilObjUser.php:2960
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilLocalUser\_getUserFolderId
static _getUserFolderId()
Definition:
class.ilLocalUser.php:120
$query
$query
Definition:
proxy_ylocal.php:13
ilLocalUser\_getAllUserIds
static _getAllUserIds($a_filter=0)
Definition:
class.ilLocalUser.php:85
$users
$users
Definition:
authpage.php:44
ilLocalUser\__construct
__construct($a_parent_id)
Constructor public.
Definition:
class.ilLocalUser.php:24
$row
$row
Definition:
migrateto20.php:360
ilLocalUser\_getUserData
static _getUserData($a_filter)
Definition:
class.ilLocalUser.php:43
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
USER_FOLDER_ID
const USER_FOLDER_ID
Class ilObjUserFolder.
Definition:
class.ilObjUserFolder.php:16
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilLocalUser\_getFolderIds
static _getFolderIds()
Definition:
class.ilLocalUser.php:57
or
ilLocalUser\$parent_id
$parent_id
Definition:
class.ilLocalUser.php:16
ilLocalUser
Definition:
class.ilLocalUser.php:12
Services
User
classes
class.ilLocalUser.php
Generated on Thu Feb 27 2025 19:02:07 for ILIAS by
1.8.13 (using
Doxyfile
)