ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilECSRemoteUser.php
Go to the documentation of this file.
1
<?
php
2
8
class
ilECSRemoteUser
9
{
10
private
$eru_id
= 0;
11
private
$sid
= 0;
12
private
$mid
= 0;
13
private
$usr_id
= 0;
14
private
$remote_usr_id
=
''
;
15
16
20
public
function
__construct
($a_eru_id = 0)
21
{
22
$this->eru_id = $a_eru_id;
23
$this->
read
();
24
}
25
31
public
static
function
factory
($a_usr_id)
32
{
33
global
$DIC
;
34
35
$ilDB
= $DIC[
'ilDB'
];
36
37
$query
=
'SELECT eru_id FROM ecs_remote_user '
.
38
'WHERE usr_id = '
.
$ilDB
->quote($a_usr_id,
'integer'
);
39
$res
=
$ilDB
->query(
$query
);
40
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
41
return
new
self
(
$row
->eru_id);
42
}
43
return
null;
44
}
45
49
public
function
exists
()
50
{
51
global
$DIC
;
52
53
$ilDB
= $DIC[
'ilDB'
];
54
55
$query
=
'SELECT eru_id FROM ecs_remote_user '
.
56
'WHERE sid = '
.
$ilDB
->quote($this->
getServerId
(),
'integer'
) .
' '
.
57
'AND mid = '
.
$ilDB
->quote($this->
getMid
(),
'integer'
) .
' '
.
58
'AND usr_id = '
.
$ilDB
->quote($this->
getUserId
(),
'integer'
);
59
$res
=
$ilDB
->query(
$query
);
60
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
61
return
(
bool
)
$row
->eru_id;
62
}
63
return
false
;
64
}
65
66
67
public
function
getId
()
68
{
69
return
$this->eru_id
;
70
}
71
72
public
function
setServerId
($a_sid)
73
{
74
$this->sid = $a_sid;
75
}
76
77
public
function
getServerId
()
78
{
79
return
$this->sid
;
80
}
81
82
public
function
setMid
($a_mid)
83
{
84
$this->mid = $a_mid;
85
}
86
87
public
function
getMid
()
88
{
89
return
$this->mid
;
90
}
91
92
93
public
function
setUserId
($a_usr_id)
94
{
95
$this->usr_id = $a_usr_id;
96
}
97
98
public
function
getUserId
()
99
{
100
return
$this->usr_id
;
101
}
102
103
public
function
setRemoteUserId
($a_remote_id)
104
{
105
$this->remote_usr_id = $a_remote_id;
106
}
107
108
public
function
getRemoteUserId
()
109
{
110
return
$this->remote_usr_id
;
111
}
112
117
public
function
update
()
118
{
119
$query
=
'UPDATE ecs_remote_user SET '
.
120
'sid = '
.
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getServerId
(),
'integer'
) .
', '
.
121
'mid = '
.
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getMid
(),
'integer'
) .
', '
.
122
'usr_id = '
.
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getUserId
(),
'text'
) .
', '
.
123
'remote_usr_id = '
.
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getRemoteUserId
(),
'text'
) .
' '
.
124
'WHERE eru_id = '
.
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getId
());
125
$GLOBALS
[
'DIC'
][
'ilDB'
]->manipulate(
$query
);
126
return
true
;
127
}
128
132
public
function
create
()
133
{
134
$next_id =
$GLOBALS
[
'DIC'
][
'ilDB'
]->nextId(
'ecs_remote_user'
);
135
$query
=
'INSERT INTO ecs_remote_user (eru_id, sid, mid, usr_id, remote_usr_id) '
.
136
'VALUES( '
.
137
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($next_id) .
', '
.
138
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getServerId
(),
'integer'
) .
', '
.
139
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getMid
(),
'integer'
) .
', '
.
140
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getUserId
(),
'text'
) .
', '
.
141
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getRemoteUserId
(),
'text'
) .
' '
.
142
')'
;
143
$GLOBALS
[
'DIC'
][
'ilDB'
]->manipulate(
$query
);
144
}
145
150
protected
function
read
()
151
{
152
if
(!$this->
getId
()) {
153
return
false
;
154
}
155
156
$query
=
'SELECT * FROM ecs_remote_user '
.
157
'WHERE eru_id = '
.
$GLOBALS
[
'DIC'
][
'ilDB'
]->quote($this->
getId
(),
'integer'
);
158
$res
=
$GLOBALS
[
'DIC'
][
'ilDB'
]->query(
$query
);
159
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
160
$this->
setServerId
(
$row
->sid);
161
$this->
setMid
(
$row
->mid);
162
$this->
setUserId
(
$row
->usr_id);
163
$this->
setRemoteUserId
(
$row
->remote_usr_id);
164
}
165
}
166
}
ilECSRemoteUser\$sid
$sid
Definition:
class.ilECSRemoteUser.php:11
ilECSRemoteUser\getMid
getMid()
Definition:
class.ilECSRemoteUser.php:87
ilECSRemoteUser\getRemoteUserId
getRemoteUserId()
Definition:
class.ilECSRemoteUser.php:108
ilECSRemoteUser\setRemoteUserId
setRemoteUserId($a_remote_id)
Definition:
class.ilECSRemoteUser.php:103
$DIC
global $DIC
Definition:
saml.php:7
ilECSRemoteUser\read
read()
Read data set.
Definition:
class.ilECSRemoteUser.php:150
ilECSRemoteUser\setMid
setMid($a_mid)
Definition:
class.ilECSRemoteUser.php:82
ilECSRemoteUser\getServerId
getServerId()
Definition:
class.ilECSRemoteUser.php:77
ilECSRemoteUser
Storage of ecs remote user.
Definition:
class.ilECSRemoteUser.php:8
ilECSRemoteUser\update
update()
Update remote user entry.
Definition:
class.ilECSRemoteUser.php:117
ilECSRemoteUser\exists
exists()
Check if entry exists for user.
Definition:
class.ilECSRemoteUser.php:49
ilECSRemoteUser\getId
getId()
Definition:
class.ilECSRemoteUser.php:67
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSRemoteUser\$remote_usr_id
$remote_usr_id
Definition:
class.ilECSRemoteUser.php:14
ilECSRemoteUser\$mid
$mid
Definition:
class.ilECSRemoteUser.php:12
ilECSRemoteUser\$usr_id
$usr_id
Definition:
class.ilECSRemoteUser.php:13
$query
$query
Definition:
proxy_ylocal.php:13
ilECSRemoteUser\setServerId
setServerId($a_sid)
Definition:
class.ilECSRemoteUser.php:72
ilECSRemoteUser\getUserId
getUserId()
Definition:
class.ilECSRemoteUser.php:98
ilECSRemoteUser\$eru_id
$eru_id
Definition:
class.ilECSRemoteUser.php:10
$row
$row
Definition:
migrateto20.php:360
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSRemoteUser\factory
static factory($a_usr_id)
Get instance for usr_id.
Definition:
class.ilECSRemoteUser.php:31
ilECSRemoteUser\setUserId
setUserId($a_usr_id)
Definition:
class.ilECSRemoteUser.php:93
ilECSRemoteUser\create
create()
Create nerw remote user entry.
Definition:
class.ilECSRemoteUser.php:132
ilECSRemoteUser\__construct
__construct($a_eru_id=0)
Constructor.
Definition:
class.ilECSRemoteUser.php:20
$GLOBALS
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Definition:
module.tag.xmp.php:702
Services
WebServices
ECS
classes
class.ilECSRemoteUser.php
Generated on Thu Feb 27 2025 19:02:08 for ILIAS by
1.8.13 (using
Doxyfile
)