ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
$ilDB
;
27
28
$this->db =
$ilDB
;
29
$this->parent_id = $a_parent_id;
30
}
31
32
public
function
setParentId
($a_parent_id)
33
{
34
$this->parent_id = $a_parent_id;
35
}
36
public
function
getParentId
()
37
{
38
return
$this->parent_id
;
39
}
40
41
public
static
function
_getUserData
($a_filter)
42
{
43
include_once
'./Services/User/classes/class.ilObjUser.php'
;
44
45
$users_data =
ilObjUser::_getAllUserData
(
array
(
"login"
,
"firstname"
,
"lastname"
,
"time_limit_owner"
), -1);
46
47
foreach
($users_data as $usr_data) {
48
if
(!$a_filter or $a_filter == $usr_data[
'time_limit_owner'
]) {
49
$users
[] = $usr_data;
50
}
51
}
52
return
$users
?
$users
:
array
();
53
}
54
55
public
static
function
_getFolderIds
()
56
{
57
global
$ilDB
,$rbacsystem;
58
59
$query
=
"SELECT DISTINCT(time_limit_owner) as parent_id FROM usr_data "
;
60
61
$res
= $ilDB->query(
$query
);
62
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
63
// Workaround for users with time limit owner "0".
64
if
(!
$row
->parent_id) {
65
if
($rbacsystem->checkAccess(
'read_users'
,
USER_FOLDER_ID
)) {
66
$parent[] =
$row
->parent_id;
67
}
68
continue
;
69
}
70
71
if
($rbacsystem->checkAccess(
'read_users'
,
$row
->parent_id) or $rbacsystem->checkAccess(
'cat_administrate_users'
,
$row
->parent_id)) {
72
if
(
$row
->parent_id) {
73
$parent[] =
$row
->parent_id;
74
}
75
}
76
}
77
return
$parent ? $parent :
array
();
78
}
79
80
public
static
function
_getAllUserIds
($a_filter = 0)
81
{
82
global
$ilDB
;
83
switch
($a_filter) {
84
case
0:
85
if
(
ilLocalUser::_getFolderIds
()) {
86
$where =
"WHERE "
. $ilDB->in(
"time_limit_owner"
,
ilLocalUser::_getFolderIds
(),
false
,
"integer"
) .
" "
;
87
//$where .= '(';
88
//$where .= implode(",",ilUtil::quoteArray(ilLocalUser::_getFolderIds()));
89
//$where .= ')';
90
}
else
{
91
//$where = "WHERE time_limit_owner IN ('')";
92
return
array
();
93
}
94
95
break
;
96
97
default
:
98
$where =
"WHERE time_limit_owner = "
. $ilDB->quote($a_filter,
"integer"
) .
" "
;
99
100
break
;
101
}
102
103
$query
=
"SELECT usr_id FROM usr_data "
. $where;
104
$res
= $ilDB->query(
$query
);
105
106
while
(
$row
= $ilDB->fetchObject(
$res
)) {
107
$users
[] =
$row
->usr_id;
108
}
109
110
return
$users
?
$users
:
array
();
111
}
112
113
public
static
function
_getUserFolderId
()
114
{
115
return
7;
116
}
117
}
// CLASS ilLocalUser
ilLocalUser\$db
$db
Definition:
class.ilLocalUser.php:14
ilLocalUser\getParentId
getParentId()
Definition:
class.ilLocalUser.php:36
ilLocalUser\setParentId
setParentId($a_parent_id)
Definition:
class.ilLocalUser.php:32
ilObjUser\_getAllUserData
static _getAllUserData($a_fields=null, $active=-1)
STATIC METHOD get all user data.
Definition:
class.ilObjUser.php:2798
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilLocalUser\_getUserFolderId
static _getUserFolderId()
Definition:
class.ilLocalUser.php:113
$query
$query
Definition:
proxy_ylocal.php:13
ilLocalUser\_getAllUserIds
static _getAllUserIds($a_filter=0)
Definition:
class.ilLocalUser.php:80
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$users
$users
Definition:
authpage.php:44
ilLocalUser\__construct
__construct($a_parent_id)
Constructor public.
Definition:
class.ilLocalUser.php:24
ilLocalUser\_getUserData
static _getUserData($a_filter)
Definition:
class.ilLocalUser.php:41
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
USER_FOLDER_ID
const USER_FOLDER_ID
Class ilObjUserFolder.
Definition:
class.ilObjUserFolder.php:16
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilLocalUser\_getFolderIds
static _getFolderIds()
Definition:
class.ilLocalUser.php:55
ilLocalUser\$parent_id
$parent_id
Definition:
class.ilLocalUser.php:16
ilLocalUser
Definition:
class.ilLocalUser.php:12
Services
User
classes
class.ilLocalUser.php
Generated on Sat Jan 18 2025 19:01:40 for ILIAS by
1.8.13 (using
Doxyfile
)